Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
10 Jul 2012 at 18:54 UTC
Updated:
9 Jul 2015 at 19:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Crell commentedOnce we're converted to using HttpCache instead of the current page cache, it should properly cache all responses. A request should never terminate early for any reason, ever, other than a bug. See #1597696: Consider whether HttpCache offers any significant benefit over the existing page cache
Comment #2
deviantintegral commentedHere's a simple patch for D7 for anyone wanting to ensure 301's are always cached. This requires that page caching be enabled, and uses exactly the same expiry rules as other responses.
Comment #3
dave reid@deviantintegral: You'll want to add the changes from #1392974: cache control headers are not correctly added to redirects as well to this patch. Basically,
Comment #4
e0ipsoI've modified @deviantintegral's patch above. I had to add the Location header manually to the headers array since it was not added through drupal_add_http_header due to the custom http response code. I also manually added the fake status header to allow the status code to be cached as well.
Comment #5
dawehnerD8 already allows you to set the http status code, so you can do pretty much all you want. Moved to d7.
Comment #6
saitanay commentedAllows caching for both 301 and 302
This could be used in conjunction with redirect module that gives an option to cache redirects.
Comment #7
dcam commentedActivating Testbot.
Comment #9
dave reidThis has one major problem: