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. ASP.NET
  4. Stopping Page caching

Stopping Page caching

Scheduled Pinned Locked Moved ASP.NET
questionsysadminhelp
5 Posts 4 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.
  • S Offline
    S Offline
    Simon Walton
    wrote on last edited by
    #1

    I have a page which returns contenttype image/png. The problem with this is that browsers always assume the image has not changed since it has the same filename. How can I force the browser to get the page that outputs the png from the server in each case, avoiding caches?

    Simon Walton
    Sonork: 10024

    P

    M T D 3 Replies Last reply
    0
    • S Simon Walton

      I have a page which returns contenttype image/png. The problem with this is that browsers always assume the image has not changed since it has the same filename. How can I force the browser to get the page that outputs the png from the server in each case, avoiding caches?

      Simon Walton
      Sonork: 10024

      P

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      I don't know if it is best way. Set the Duration propoerty of OutputCache tag to 0 at the top of your page. Mazy "Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland

      1 Reply Last reply
      0
      • S Simon Walton

        I have a page which returns contenttype image/png. The problem with this is that browsers always assume the image has not changed since it has the same filename. How can I force the browser to get the page that outputs the png from the server in each case, avoiding caches?

        Simon Walton
        Sonork: 10024

        P

        T Offline
        T Offline
        T Manjaly
        wrote on last edited by
        #3

        It is a browser setting that controls image caching.. I am not if there is a way to control this from server side code. :zzz:----------------------------------------------------------------------:(( T Manjaly
        C# Tutorials and samples : http://www.dotnetspider.com

        1 Reply Last reply
        0
        • S Simon Walton

          I have a page which returns contenttype image/png. The problem with this is that browsers always assume the image has not changed since it has the same filename. How can I force the browser to get the page that outputs the png from the server in each case, avoiding caches?

          Simon Walton
          Sonork: 10024

          P

          D Offline
          D Offline
          dantelp
          wrote on last edited by
          #4

          i've never tried it before so i'm not sure if it will work for images, but i imagine that if you add a randomly generated querystring to the image link the browser might decide not to cache it. if it does work, you should definitely test it on the different browsers and versions. for example

          S 1 Reply Last reply
          0
          • D dantelp

            i've never tried it before so i'm not sure if it will work for images, but i imagine that if you add a randomly generated querystring to the image link the browser might decide not to cache it. if it does work, you should definitely test it on the different browsers and versions. for example

            S Offline
            S Offline
            Simon Walton
            wrote on last edited by
            #5

            I did actually think of that! Doesn't seem to work though. :(

            Simon Walton
            Sonork: 10024

            P

            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