How to prevent a page from being cached in the temp. internet files

Hi,

I've got a little problem.

I want a page to be loaded from my website everytime it is accessed, but it doesn't work. The page is allways placed in the temporary internet files folder and when you acces it again you get the old version of it. This is not supposed to happen.

Where do I need this for?
-------------------------
I've created a php script that copies a file to a username.html file. Everytime a user links to a page and let the user open this username.html file in stead of the original file. Everytime a user clicks on a different link this page changes on the server. After the copy command I let the user jump to the page with a piece of javascript
[code]



[/code]

What did I try to solve this?
-----------------------------
I tried placing the following lines in the head of the html file, but it doesn't work. I also tried to place it at the beginning of my file even before the tag, but it also didn't work. And I even tried it with : at the end like Expires: and Cache-Control: etc... nothing worked.
[code]



[/code]

Please help me out with this...




;-)
-mac-
mailto:programmersheaven@mac-doggie.nl
the Netherlands...

Comments

  • I think it's just an IE bug ;-)
    Do you get the same problem with Netscape ?


    : Hi,
    :
    : I've got a little problem.
    :
    : I want a page to be loaded from my website everytime it is accessed, but it doesn't work. The page is allways placed in the temporary internet files folder and when you acces it again you get the old version of it. This is not supposed to happen.
    :
    : Where do I need this for?
    : -------------------------
    : I've created a php script that copies a file to a username.html file. Everytime a user links to a page and let the user open this username.html file in stead of the original file. Everytime a user clicks on a different link this page changes on the server. After the copy command I let the user jump to the page with a piece of javascript
    : [code]
    :
    :
    :
    : [/code]
    :
    : What did I try to solve this?
    : -----------------------------
    : I tried placing the following lines in the head of the html file, but it doesn't work. I also tried to place it at the beginning of my file even before the tag, but it also didn't work. And I even tried it with : at the end like Expires: and Cache-Control: etc... nothing worked.
    : [code]
    :
    :
    :
    : [/code]
    :
    : Please help me out with this...
    :
    :
    :
    :
    : ;-)
    : -mac-
    : mailto:programmersheaven@mac-doggie.nl
    : the Netherlands...
    :
    :

  • Here is the solution:

    Using PHP or whatever, generate a random number and append this to the file you don't want to be cached (with the ? sign ofcourse)

    So:

    http://www.somedomain.com/somedir/yourfile.html

    Would become:

    http://www.somedomain.com/somedir/yourfile.html?randomnumber=589345

    IE will cache this file, but every time the number changes, IE treads it as a different file.

    Hope this helped.


    : Hi,
    :
    : I've got a little problem.
    :
    : I want a page to be loaded from my website everytime it is accessed, but it doesn't work. The page is allways placed in the temporary internet files folder and when you acces it again you get the old version of it. This is not supposed to happen.
    :
    : Where do I need this for?
    : -------------------------
    : I've created a php script that copies a file to a username.html file. Everytime a user links to a page and let the user open this username.html file in stead of the original file. Everytime a user clicks on a different link this page changes on the server. After the copy command I let the user jump to the page with a piece of javascript
    : [code]
    :
    :
    :
    : [/code]
    :
    : What did I try to solve this?
    : -----------------------------
    : I tried placing the following lines in the head of the html file, but it doesn't work. I also tried to place it at the beginning of my file even before the tag, but it also didn't work. And I even tried it with : at the end like Expires: and Cache-Control: etc... nothing worked.
    : [code]
    :
    :
    :
    : [/code]
    :
    : Please help me out with this...
    :
    :
    :
    :
    : ;-)
    : -mac-
    : mailto:programmersheaven@mac-doggie.nl
    : the Netherlands...
    :
    :

  • It's a good idea, i'll try it.

    : Here is the solution:
    :
    : Using PHP or whatever, generate a random number and append this to the file you don't want to be cached (with the ? sign ofcourse)
    :
    : So:
    :
    : http://www.somedomain.com/somedir/yourfile.html
    :
    : Would become:
    :
    : http://www.somedomain.com/somedir/yourfile.html?randomnumber=589345
    :
    : IE will cache this file, but every time the number changes, IE treads it as a different file.
    :
    : Hope this helped.
    :
    :
    : : Hi,
    : :
    : : I've got a little problem.
    : :
    : : I want a page to be loaded from my website everytime it is accessed, but it doesn't work. The page is allways placed in the temporary internet files folder and when you acces it again you get the old version of it. This is not supposed to happen.
    : :
    : : Where do I need this for?
    : : -------------------------
    : : I've created a php script that copies a file to a username.html file. Everytime a user links to a page and let the user open this username.html file in stead of the original file. Everytime a user clicks on a different link this page changes on the server. After the copy command I let the user jump to the page with a piece of javascript
    : : [code]
    : :
    : :
    : :
    : : [/code]
    : :
    : : What did I try to solve this?
    : : -----------------------------
    : : I tried placing the following lines in the head of the html file, but it doesn't work. I also tried to place it at the beginning of my file even before the tag, but it also didn't work. And I even tried it with : at the end like Expires: and Cache-Control: etc... nothing worked.
    : : [code]
    : :
    : :
    : :
    : : [/code]
    : :
    : : Please help me out with this...
    : :
    : :
    : :
    : :
    : : ;-)
    : : -mac-
    : : mailto:programmersheaven@mac-doggie.nl
    : : the Netherlands...
    : :
    : :
    :
    :

    ;-)
    -mac-
    mailto:programmersheaven@mac-doggie.nl
    the Netherlands...


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories