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

Created on 23 September 2022, about 2 years ago
Updated 8 September 2023, over 1 year ago

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 Drupal root .htaccess file now caches all files for 1 year instead of two weeks. This bring the value in line with industry standards.

✨ Feature request
Status

Fixed

Version

10.1 ✨

Component
OtherΒ  β†’

Last updated 3 minutes ago

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024