caching problem

Discussion in 'HTML' started by Bruno, Oct 4, 2005.

  1. Bruno

    Bruno Guest

    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
     
    Bruno, Oct 4, 2005
    #1
    1. Advertising

  2. Bruno

    Stuart Guest

    Bruno wrote:
    > 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.

    --
    Stuart Brown <>
    http://www.edesign.cc
     
    Stuart, Oct 4, 2005
    #2
    1. Advertising

  3. On Tue, 4 Oct 2005, Stuart wrote:

    > Bruno wrote:
    > >
    > > 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.


    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...

    > > If I add or delete a file and refresh the page by F5 (IE), I will not see
    > > the changes most of the time,


    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.

    > >although I have these code of lines in the
    > > header section:
    > >
    > > <meta http-equiv="expires" content="0">
    > > <meta http-equiv="pragma" content="no-cache">


    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
     
    Alan J. Flavell, Oct 4, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Reazor
    Replies:
    2
    Views:
    539
    Yan-Hong Huang[MSFT]
    Jul 21, 2003
  2. Paul M. Frazier, Ph.D.

    Page Caching Problem

    Paul M. Frazier, Ph.D., Jul 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    402
    Khan Imran
    Jul 28, 2003
  3. Hypo
    Replies:
    6
    Views:
    433
  4. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    810
    Troy Simpson
    Jan 19, 2004
  5. JimLad
    Replies:
    3
    Views:
    930
    JimLad
    Jan 21, 2010
Loading...

Share This Page