• Sales: 1-800-961-2888
  • Support: 1-800-961-4454

How Can I Disable Caching on Cloud Sites?


Below are methods for bypassing cache if you don't want your image delivery to be accelerated, or if you want to force a freshness check on every request. Each of the options below should be used with care. Each one will result in slower end user performance to your site, and in some cases, it will increase your bandwidth fees. Use them only if you need them, and only for the files you need them for.

Contents

Disable Caching in PHP using .htaccess

 

<IfModule mod_php5.c>
          <IfModule mod_headers.c>
               <FilesMatch "\.(ico|flv|jpg|jpeg|png|gif|swf|mpeg|wav|mp3|wma|mpg|css|js)$">
                   Header set Cache-Control "no-cache"
               </FilesMatch>
          </IfModule>
</IfModule>
 

Disable Caching in Windows using web.config

 

<configuration>
          <system.webServer>
               <httpProtocol>
                    <customHeaders>
                         <add name="Cache-Control" value="no-cache" />
                    </customHeaders>
              </httpProtocol>
          </system.webServer>
</configuration>

 







© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER