Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Caching html pages - no thanks - but how?

Caching html pages - no thanks - but how?

Scheduled Pinned Locked Moved Web Development
helpannouncementhtmlsysadmintutorial
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lvq684
    wrote on last edited by
    #1

    Hi. This issue has bothered me for some time now. I have quite a normal website, with different html files. If I make changes to a file, I can (sometimes!) see the changes when I hit f5. But if the file is fully replaced (same name and extension though), my browser shows the previous cached page. So I have to manually right click in the frame, and reload it to see the new version of the page. After many times googling to address this issue, Ive come up with these meta tages in top of each page:

    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    <meta http-equiv='pragma' content='no-cache'>

    But little does it help. The problem is still there. Why? And how to solve it? I´ve inspected of other sites that updates several times a day. They have have no special meta tags or alike in their html pages. And it´s of course not nescasary to update the page manually. Is it a server side setting or what figures? Thanks alot for your time :)

    G 1 Reply Last reply
    0
    • L lvq684

      Hi. This issue has bothered me for some time now. I have quite a normal website, with different html files. If I make changes to a file, I can (sometimes!) see the changes when I hit f5. But if the file is fully replaced (same name and extension though), my browser shows the previous cached page. So I have to manually right click in the frame, and reload it to see the new version of the page. After many times googling to address this issue, Ive come up with these meta tages in top of each page:

      <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
      <META HTTP-EQUIV="Expires" CONTENT="-1">
      <meta http-equiv='pragma' content='no-cache'>

      But little does it help. The problem is still there. Why? And how to solve it? I´ve inspected of other sites that updates several times a day. They have have no special meta tags or alike in their html pages. And it´s of course not nescasary to update the page manually. Is it a server side setting or what figures? Thanks alot for your time :)

      G Offline
      G Offline
      Gerben Jongerius
      wrote on last edited by
      #2

      This is not a serverside issue, cache control is arranged by the client. If the client suspects the content to be out of date the browser will sent a head request. The server then replies with status 200 if there is a new version. To disable caching on the browser you can set the following 2 headers: Cache-Control: no-cache, must-revalidate Expires: Sat, 26 Jul 1997 05:00:00 GMT This should disable browser cache.

      L 1 Reply Last reply
      0
      • G Gerben Jongerius

        This is not a serverside issue, cache control is arranged by the client. If the client suspects the content to be out of date the browser will sent a head request. The server then replies with status 200 if there is a new version. To disable caching on the browser you can set the following 2 headers: Cache-Control: no-cache, must-revalidate Expires: Sat, 26 Jul 1997 05:00:00 GMT This should disable browser cache.

        L Offline
        L Offline
        lvq684
        wrote on last edited by
        #3

        Alright, so that would be like: and Right?

        G 1 Reply Last reply
        0
        • L lvq684

          Alright, so that would be like: and Right?

          G Offline
          G Offline
          Gerben Jongerius
          wrote on last edited by
          #4

          That's correct.

          L 2 Replies Last reply
          0
          • G Gerben Jongerius

            That's correct.

            L Offline
            L Offline
            lvq684
            wrote on last edited by
            #5

            Thanks alot, I´ll give it a try :)

            1 Reply Last reply
            0
            • G Gerben Jongerius

              That's correct.

              L Offline
              L Offline
              lvq684
              wrote on last edited by
              #6

              Hi again. I´ve tried what you suggested, but I has no effect. The problem is the same :( Any idea?

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups