Hello,
I am using the following rules to cache static files in .htaccess:
All works fine except files that were pre-compressed on the server (Brotli):
Could anyone advice which rules should be added to .htaccess to override period for such files from 30 days to 365 days?
I am using Brotli.
Thanks.
I am using the following rules to cache static files in .htaccess:
Code:
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript ExpiresActive on ExpiresDefault "access plus 1 month" ExpiresByType text/cache-manifest "access plus 0 seconds" <FilesMatch \.(html|xhtml|xml|shtml|phtml|php|txt)$> ExpiresDefault "access plus 0 seconds" </FilesMatch> ExpiresByType text/html "access plus 0 seconds" ExpiresByType text/xml "access plus 0 seconds" ExpiresByType application/xml "access plus 0 seconds" ExpiresByType application/json "access plus 0 seconds" ExpiresByType application/rss+xml "access plus 1 hour" ExpiresByType application/atom+xml "access plus 1 hour" <FilesMatch \.(ico)$> ExpiresDefault "access plus 1 week" </FilesMatch> ExpiresByType image/x-icon "access plus 1 week" <FilesMatch \.(gif|png|jpg|jpeg|webp|avif|ogg|mp4|mkv|flv|swf|wmv|asf|asx|wma|wax|wmx|wm)$> ExpiresDefault "access plus 1 year" </FilesMatch> ExpiresByType image/gif "access plus 365 days" ExpiresByType image/png "access plus 365 days" ExpiresByType image/jpeg "access plus 365 days" ExpiresByType video/ogg "access plus 365 days" ExpiresByType audio/ogg "access plus 365 days" ExpiresByType video/mp4 "access plus 2 month" ExpiresByType video/webm "access plus 2 month" ExpiresByType text/x-component "access plus 2 month" <FilesMatch \.(eot|ttf|otf|svg|woff|woff2)$> ExpiresDefault "access plus 1 year" </FilesMatch> ExpiresByType application/x-font-ttf "access plus 6 month" ExpiresByType font/opentype "access plus 6 month" ExpiresByType application/x-font-woff "access plus 6 month" ExpiresByType application/x-font-woff2 "access plus 6 month" ExpiresByType image/svg+xml "access plus 6 month" ExpiresByType application/vnd.ms-fontobject "access plus 2 month" <FilesMatch \.(css|js)$> ExpiresDefault "access plus 1 year" </FilesMatch> ExpiresByType text/css "access plus 365 days" ExpiresByType application/javascript "access plus 365 days" <FilesMatch \.(swf|pdf|doc|rtf|xls|ppt)$> ExpiresDefault "access plus 1 year" </FilesMatch> ExpiresByType application/x-shockwave-flash "access plus 1 year" ExpiresByType application/pdf "access plus 1 year" ExpiresByType application/msword "access plus 1 year" ExpiresByType application/rtf "access plus 1 year" ExpiresByType application/vnd.ms-excel "access plus 1 year" ExpiresByType application/vnd.ms-powerpoint "access plus 1 year"
Could anyone advice which rules should be added to .htaccess to override period for such files from 30 days to 365 days?
I am using Brotli.
Thanks.
Statistics: Posted by Sulpher — Mon Apr 29, 2024 7:02 pm