By default, all files will have a cache lifetime of only 7 days because that's what's set in the .htaccess
file. It would be great if we could specify a longer lifetime for static assets.
Here is the recommended code from AdvAgg for Drupal:
<FilesMatch "^(css|js)__[A-Za-z0-9-_]{43}__[A-Za-z0-9-_]{43}__[A-Za-z0-9-_]{43}.(css|js)(\.gz|\.br)?">
# No mod_headers. Apache module headers is not enabled.
<IfModule !mod_headers.c>
# No mod_expires. Apache module expires is not enabled.
<IfModule !mod_expires.c>
# Use ETags.
FileETag MTime Size
</IfModule>
</IfModule>
# Use Expires Directive if apache module expires is enabled.
<IfModule mod_expires.c>
# Do not use ETags.
FileETag None
# Enable expirations.
ExpiresActive On
# Cache all aggregated css/js files for 52 weeks after access (A).
ExpiresDefault A31449600
</IfModule>
# Use Headers Directive if apache module headers is enabled.
<IfModule mod_headers.c>
# Do not use etags for cache validation.
Header unset ETag
<IfModule !mod_expires.c>
# Set a far future Cache-Control header to 52 weeks.
Header set Cache-Control "max-age=31449600, no-transform, public"
</IfModule>
<IfModule mod_expires.c>
Header append Cache-Control "no-transform, public"
</IfModule>
</IfModule>
</FilesMatch>
GitHub Issue #:
3937
Recent comments
I'm glad you've found it quite useful too! I'm curious to know why you'd like to unpublish some of your modules or themes? They're not ready or are they more personal projects? I can help...
My work and a big thanks to all of you
Slight improvement to @argiepiano's procedure. Again for PR 4690, it would be: Using shell access, go to the Backdrop doc root. Run this command to get the diff file...
Workflow for core update with fixes that are not yet in core
This issue is seeing some progress, but there are some questions that might benefit from a UX discussion. https://github.com/backdrop/backdrop-issues/issues/2894
Apr 18th Weekly Meetings