No, it controls only the current document. If you donβt want ugly URIs with random query strings, then itβs time to configure your server. Assuming Apache:
# mod_expires directives: # enable expires/max-age headers and set default to 0 seconds from last access time ExpiresActive On ExpiresDefault A0 # configure ExpiresByType on your specific types, eg ExpiresByType text/css A0 # mod_headers directives: # send variety of no-cache directives, should cover any quirky clients and gateways Header set Cache-Control "max-age=0, private, no-cache, no-store, must-revalidate, proxy-revalidate, no-transform" Header set Pragma "no-cache" # enclose this in <Files> directive for specific file eg <Files *.js>
These directory groups will also work in configurations for each directory ( .htaccess files) (in the case of a host with a common environment), given the following requirements:
AllowOverride FileInfo validmod_headers or mod_headers
If both options are enabled - note that the groups overlap on max-age , you want to remove it from Header and use finer control using ExpiresXXXX . The described setting is quite common for a shared hosting environment, so ask the server administrator or try it yourself (it will return 500 Internal Server Error if the corresponding module is not enabled or has no effect if .htaccess processing .htaccess not enabled)
source share