How to prevent PHP from caching using .htaccess -


i using following code caching unknown known files don't want php cached since causing problem dynamic scripts. note don't want add header every php files avoid cached. please suggest me if possible prevent php getting cached.

<ifmodule mod_expires.c>     expiresactive on     expiresbytype image/jpg "access 1 year"     expiresbytype image/jpeg "access 1 year"     expiresbytype image/gif "access 1 year"     expiresbytype image/png "access 1 year"     expiresbytype text/css "access 1 month"     expiresbytype application/pdf "access 1 month"     expiresbytype text/x-javascript "access 1 month"     expiresbytype application/x-shockwave-flash "access 1 month"     expiresbytype image/x-icon "access 1 year"     expiresdefault "access 1 year"     </ifmodule> 

should work in both .htaccess , httpd.conf

<filesmatch "\.(html|htm|js|css)$">  fileetag none  <ifmodule mod_headers.c>  header unset etag  header set cache-control "max-age=0, no-cache, no-store, must-revalidate"  header set pragma "no-cache"  header set expires "wed, 11 jan 1984 05:00:00 gmt" </ifmodule> </filesmatch> 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -