I am trying to set a cache control header when a browser requsets the following url:
www.example.com/php/getData.php?exampleField=exampleValue
As even though getData.php is a dynamic page, when the parameter exampleField
equals exampleValue
the response doesnt change. Therefore, there is no reason for the browser not to cache this result. My question is how do I write a FilesMatch
rule in the .htaccess file to match this, I tried the following with no luck:
<FilesMatch "php/getData.php\?exampleField=(exampleValue1|exampleValue2)$">
Header set Cache-Control "max-age=3024000, must-revalidate"
</FilesMatch>