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. VirtualPathProvider and Caching

VirtualPathProvider and Caching

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-nethardwarehelp
1 Posts 1 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.
  • M Offline
    M Offline
    Michael Wolski
    wrote on last edited by
    #1

    We have a ASP.Net 1.1 application we are moving to ASP.Net 2.0. The resources for this application are embedded, and served up using a virutal HTTP module. For example, an image on a page would have a url of getimage.aspx?smiley.gif , and the actual smiley.gif image is embedded in a .dll as a resource. The module extracts and serves up the image when it is called. In ASP.Net 2.0 I have implemented a VirtualPathProvider to do the same thing, and it appears to work but with 1 caveat: The first call to the resource is cached and that value is always used. So if I make a call to getimage.aspx?smiley.gif I get the correct image, but if I make the call again to (say) getimage.aspx?frowny.gif I get the smiley.gif image. I have debugged this to the point I know that the 2nd call isn't coming through, and figure it is caching my virtual url after the first call. How can I stop this? I want it to never cache the getimage.aspx page (or at least to detect the parameters are different, which I would have thought it should be doing anyway) Note: I have overridden GetCacheDependency to return Null, and it didn't change anything. I also tried overriding GetCacheKey, providing it unique keys for each call, to no avail. Any help/insight on this?

    Michael Developer, Author, Chef

    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