How to disable proxy caching with .htaccess?

Member

by denis , in category: Third Party Scripts , 2 months ago

How to disable proxy caching with .htaccess?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by kadin , 2 months ago

@denis 

To disable proxy caching with .htaccess, you can use the following code:

1
2
3
4
5
6
# Disable proxy caching
<IfModule mod_headers.c>
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires 0
</IfModule>


Simply add this code to your .htaccess file in the root directory of your website. This will prevent proxies from caching your content by setting the Cache-Control, Pragma, and Expires headers to ensure that the content is not stored in the cache.