Вопрос

Gidday

I've currently got js files set up as must-revalidate, to overcome mobile networks caching old versions when I do updates.

<FilesMatch ".(js)$">
Header set Cache-Control "max-age=608000"
Header set Cache-Control "must-revalidate"
</FilesMatch>

I have some .js files that I never change, so I was wondering how to go about making an exception for these files?

Thanks for your time and help.

Это было полезно?

Решение

You can add another FilesMatch section for those specific files:

<FilesMatch "\.js$">
Header set Cache-Control "max-age=608000"
Header set Cache-Control "must-revalidate"
</FilesMatch>

# CACHED FOREVER
<FilesMatch "(file1|file2)\.js$">
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
</FilesMatch>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top