Clearing Browser Cache

You may have trouble when you want a particular page to load every time from server and it is not doing so because of browser cache of a user browser.

Lets take an example you have used captcha on a form and user opens that page to fill form but he start browsing other pages of your site and in last he comes back to fill the form at this time captcha is having old images because this image is been picked by cache instead of server, when he will try to submit form then he will het error that entered captcha text is incorrect, to prevent this you want to load these images every time from server.To do this you can use any of given below code:

<body onload="window.location.reload();">

or this

Header("Cache-control: private, no-cache");
Header("Expires: Mon, 26 Jun 1997 05:00:00 GMT");
Header("Pragma: no-cache");

Subscribe / Share

Article by Irfan Raza

Authors bio is coming up shortly.

2 Comments

  1. Foeria says:

    в конце концов: отлично.. а82ч

  2. Irfan Raza says:

    Thanks for comment in Russian i translated it using Google languages tool:-
    in the end: excellent .. a82ch

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>