PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > Browser keeps caching
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Browser keeps caching

Réponse
 
LinkBack Outils de la discussion
Vieux 06/09/2007, 09h21   #1
news.xs4all.nl
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Browser keeps caching

Hi,

I have a problem with Internet Explorer (v7). It's not my favorite browser,
but you do have to test your websites in it.

In my browser, I have selected the cache option "Every time I visit the
website".
In the PHP code I included:

header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Expires: Mon, 1 Jan 2000 00:00:00 GMT"); // Date in the past
header("Pragma: no-cache");

Still I need to refresh the page with Ctrl-F5, pressing just F5 returns an
old version of the page.

Do I miss something here?

Thanks,
Ramon.

  Réponse avec citation
Vieux 06/09/2007, 15h12   #2
Steve
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Browser keeps caching


"news.xs4all.nl" <itsramon@gmail.com> wrote in message
news:46dfb86a$0$229$e4fe514c@news.xs4all.nl...
> Hi,
>
> I have a problem with Internet Explorer (v7). It's not my favorite
> browser, but you do have to test your websites in it.
>
> In my browser, I have selected the cache option "Every time I visit the
> website".
> In the PHP code I included:
>
> header("Cache-Control: no-store, no-cache, must-revalidate");
> header("Cache-Control: post-check=0, pre-check=0", false);
> header("Expires: Mon, 1 Jan 2000 00:00:00 GMT"); // Date in the past
> header("Pragma: no-cache");
>
> Still I need to refresh the page with Ctrl-F5, pressing just F5 returns an
> old version of the page.
>
> Do I miss something here?
>
> Thanks,
> Ramon.



i'm not sure this is still an issue with IE, but their website used to say
that to 'ensure' a page wasn't cached in IE you would need to set the
headers and at the bottom of the page somewhere, include a meta tag for
cache as well. they gave a long explanation for this, but i really don't,
nor care to, remember. it's just one of those things you have to work with.

either way and having said all of that, there is NO guarantee in ANY browser
that your server's request to not cache a page's content will be honored.


  Réponse avec citation
Vieux 06/09/2007, 18h55   #3
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Browser keeps caching

news.xs4all.nl wrote:
> Hi,
>
> I have a problem with Internet Explorer (v7). It's not my favorite
> browser, but you do have to test your websites in it.
>
> In my browser, I have selected the cache option "Every time I visit the
> website".
> In the PHP code I included:
>
> header("Cache-Control: no-store, no-cache, must-revalidate");
> header("Cache-Control: post-check=0, pre-check=0", false);
> header("Expires: Mon, 1 Jan 2000 00:00:00 GMT"); // Date in the past
> header("Pragma: no-cache");
>
> Still I need to refresh the page with Ctrl-F5, pressing just F5 returns
> an old version of the page.
>
> Do I miss something here?


Beyond the fact that MSIE7 is yet more buggy than previous versions, you
should never count on that a browser or proxy won't cache even if you tell it
to not do so in the headers/meta-tags, there still user settings which you
never will be able to control.

--

//Aho
  Réponse avec citation
Vieux 07/09/2007, 05h05   #4
ravindra
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Browser keeps caching

the best way to avoid cache is to append a dummy parameter in all your
requests sent to the server
like
say you have url http://www.yourdomain.com/page.php?i...eparameter=aaa

then append that url with a dummy parameter which will have a random
value like ....

"http://www.yourdomain.com/page.php?
id=123&someparameter=aaa&dummy=".rand()

this should ask browser to send request to the server and fetch new
response..
but still images and other things in the page would be cached on the
browser side...if u want to avoid that follow the same procedure for
all the request to the server...

--ravi

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h50.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09049 seconds with 12 queries