Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6743 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Cached redirect_to (using caches_page :action) doesn't redirect

Reported by: anamba Assigned to: David
Priority: normal Milestone: 1.x
Component: ActionPack Version: 1.1.6
Severity: normal Keywords:
Cc:

Description

If you have an action that returns a redirect_to for a particular id (or in my case, a lack thereof), caches_page, quite naturally, will capture the html output, but not the header that causes the redirect. This is expected, but annoying.

When I have a bit more time, I'll look into this more to see if there is a nice, clean way to fix the problem. I expect the cleanest way would be to block page caching when action processing terminates in a redirect_to.

Attachments

cache_only_for_200_OK.diff (3.0 kB) - added by anamba on 12/14/06 20:11:17.

Change History

12/01/06 22:03:49 changed by bitsweat

Page caching should check for status 200 OK rather than allowing any status < 400.

12/14/06 20:11:17 changed by anamba

  • attachment cache_only_for_200_OK.diff added.

12/14/06 20:11:53 changed by anamba

  • summary changed from Cached redirect_to (using caches_page :action) doesn't redirect to [PATCH] Cached redirect_to (using caches_page :action) doesn't redirect.

12/19/06 20:25:52 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [5755]) Only cache GET requests with a 200 OK response. Closes #6514, #6743.

12/19/06 20:27:36 changed by bitsweat

(In [5756]) Merge [5755] from trunk. Closes #6514, closes #6743.