Problem/Motivation
.htaccess ExpiresDefault is intended for static content rather than 301 redirects.
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600However, when adding 301 redirects in Drupal's .htaccess file, the same 2 weeks will be applied.
$ curl -sIXGET http://www.mysite.com | grep -i 'cache\|http\|age'
HTTP/1.1 301 Moved Permanently
Location: https://www.mysite.com/
Cache-Control: max-age=1209600
Age: 60
X-Cache: HIT
X-Cache-Hits: 2Proposed resolution
The suggestion here is we update the .htaccess file to indicate this because it can be really confusing to realize not only files but also redirects are going to be cached for 2 weeks.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
None.
| Comment | File | Size | Author |
|---|---|---|---|
| clarify-2-weeks-redirect-caching.patch | 358 bytes | anavarre |
Comments
Comment #2
anavarreComment #8
larowlanComment #10
anybodyConfirming this is still relevant. Still the 2 weeks seems much to low having a look at Google Pagespeed or GTMetrix recommendations that should be ~1Y instead!
If that's a reason to split this for redirects, please set this back to NW. I've opened a separate issue for a higher
ExpiresDefaultvalue: #3311406: .htaccess ExpiresDefault (2W) is much too low. Should be ~1YComment #11
alexpottI've backported this to 9.5.x as although it is an htaccess change it is only a comment. Therefore I don't believe this issue is worth a CR telling people to update their .htaccess files.
Committed and pushed 104b0e0807 to 10.1.x and d603c6dbed to 10.0.x and 04c799d13b to 9.5.x. Thanks!