2018年6月16日 星期六

Let whole website or virtual path has no caching

Put it in 000-default.conf or xxx.conf in conf-enabled
The first line indicate the no cache function only working on js file.

<FilesMatch "\.js$">
        FileETag None

        <IfModule mod_headers.c>
            Header unset ETag
            Header set Cache-Control "max-age=0, no-cache, no-store, must-reval$
            Header set Pragma "no-cache"
            Header set Note "CACHING IS DISABLED ON LOCALHOST"
            Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
        </IfModule>
    </FilesMatch>

沒有留言: