Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291783

.htaccess ExpiresDefault (2W) is much too low. Should be ~1Y

$
0
0

Problem/Motivation

Testing Drupal 9 Websites with Google Pagespeed or GTMetrix

If your static files do not change (or you have an appropriate strategy for cache busting), then we recommend setting your cache policy to 6 months or 1 year.

For completed websites, things like global CSS/JS files, logos, images, etc., generally do not change much, and so 6 months or 1 year is a good cache expiry to work with.

(https://gtmetrix.com/serve-static-assets-with-an-efficient-cache-policy....)

We recommend a minimum cache time of one week and preferably up to one year for static assets, or assets that change infrequently. If you need precise control over when resources are invalidated, we recommend using a URL fingerprinting or versioning technique - see invalidating and updating cached responses link above.

https://developers.google.com/speed/docs/insights/LeverageBrowserCaching

Steps to reproduce

Test a Drupal 9 website using Apache (.htaccess) with tools like

and see the complaints about the too low expiration

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

The root ".htaccess" file now has an increased "ExpiresDefault" value of one year. The value got increased to one year
Reason being, the recommendation by both Google Pagespeed and GTMetrix to increase the cache policy to one year for static files.


Viewing all articles
Browse latest Browse all 291783

Trending Articles