caching problem

B

Bruno

Hi there,

I have to use a flash file as an intro (customer requirements) with a
dropdown to select countries. After the user has selected a country, I
transfer to a frame page.

The FramePage (created by PHP) searches a directory and displays the files.

If I add or delete a file and refresh the page by F5 (IE), I will not see
the changes most of the time, although I have these code of lines in the
header section:

<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">

What can I do? Could I use a variable in the session management, for example
the time/date to make the browser / caching system think, that the page has
changed?

Or is there another solution?

Thanks for any hints

Bruno
 
S

Stuart

Bruno said:
Hi there,

I have to use a flash file as an intro (customer requirements) with a
dropdown to select countries. After the user has selected a country, I
transfer to a frame page.

The FramePage (created by PHP) searches a directory and displays the files.

If I add or delete a file and refresh the page by F5 (IE), I will not see
the changes most of the time, although I have these code of lines in the
header section:

<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">

What can I do? Could I use a variable in the session management, for example
the time/date to make the browser / caching system think, that the page has
changed?

Or is there another solution?

Thanks for any hints

Bruno

You could try [Shift] - [F5], to force a refresh, or failing that you
could try using the PHP 'header' command to put the Pragma: no-cache
into the HTTP response. It may also be dependent on your server's settings.
 
A

Alan J. Flavell

Sounds like the kind of site I'd never visit a second time, unless
there was some *really* compelling reason. From that description, it
seems it pushes most of my "run away, run away" buttons...

Is this about you, or about your users? Is it life-critical to your
users that they never get a page that's out of date by even a few
minutes?

If you're only trying to review your *own* updates, then surely the
clue is to use your browser to reload the new version. Don't nobble
the server just for your own convenience.

Don't do that, it's a "cure" that's far worse than the disease, and
anyway it doesn't (in general) work.

And, contrary to what seems to be popular superstition, when it works
at all, it acts on the HTML object which contains it, and not on the
images, flash files and other stuff to which that object links.
(Unless you happen to have found some browser-like object whose
response is even worse than normal, due to having to keep re-fetching
even the objects which never change...)

What I'd recommend is:

* Have a read of the principles set out in Mark Nottingham's tutorial

* Work out what you (or rather, the site's readers) *really* need in
terms of updates, versus cacheability => speed of response.

* Implement it...

http://www.mnot.net/cache_docs/
You could try [Shift] - [F5], to force a refresh,

Yup, though the actual details of how to do that depend on the browser
used...
or failing that you could try using the PHP 'header' command to put
the Pragma: no-cache into the HTTP response. It may also be
dependent on your server's settings.

You'd certainly be advised to put any cache-control statements into
the real HTTP header, and indeed PHP can do that, as you rightly say.
(But check what you're going to do for non-HTML objects too!).

However, "Pragma: no-cache" (an HTTP/1.0 kludge) is an unnecessarily
crude sledgehammer for achieving what's wanted here, at least with any
server version from this millennium.

I particularly recommend an occasional spin with Nottingham's
"cacheability engine", referenced in the above-mentioned tutorial.

good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top