In this Example, I am going to show that how can we disable cache completely in our project in PHP. Some time we are unable to see the changes that we do into the website. So we have to clear the cache again and again in our project. So we need to disable the cache from the website so that we can see the changes immediately into the website.

In this code we are using header for expiring time in PHP page. Last 3 header function we are giving permission to not to store cache in system.

Example: -

           <?php
                          header(“Expires: Mon, 10 Sep 2011 07:10:30 GMT”);
                          header(“Last-Modify: ” . gmdate(“D, d M Y H:i:s”) . ” GMT”);
                          header(“Cache-Control: no-store, no-cache, must-revalidate, max-age=0″);
                          header(“Cache-Control: post-check=0, pre-check=0″, false);
                          header(“Pragrma: no-cache”);
           ?>

If you have any problem using this code then contact me through the contact form in the footer. I will contact you as soon as possible and along with that if you have any query regarding Adsense or blogging or any other coding then question me from the contact form or mail.

0 comments :

Post a Comment

 
# Top