Page Output Caching not working

Results 1 to 2 of 2

Thread: Page Output Caching not working

  1. #1
    Join Date
    Dec 1969

    Default Page Output Caching not working

    I&#039;ve got a page that uses output caching. It uses 3 user controls and makes 3 different database calls - there&#039;s NO user interaction, no form variables, no querystrings, it just displays content out of the db&#039;s - so I&#039;d like to use output caching to cache the entire page. <BR><BR>My code --&#062; &#060;%@OutputCache Duration="3600" VaryByParam="none" %&#062; <BR><BR>My page is caching like it should once in awhile but decides to render everything from scratch again every 60 seconds or so. Does anyone know what&#039;s causing this? <BR><BR>UPDATE : Does anyone know any server issues that might cause this? <BR><BR>When I run the page on my machine, the cache seems to be working like it&#039;s supposed to but when I upload it to my web host, the page is rebuilding itself every 30 to 60 seconds...<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Page Output Caching not working

    The only thing I can think of is if your host is using a server farm. In this case, you might be using a different server when you request a page sometimes. Each server may have to cache its own copy.<BR><BR>I&#039;m really not sure, but it sounds similar to my viewstate problem a couple weeks ago. Because the machine key kept changing from server to server, I kept getting a viewstate invalid error (the viewstate hash is based on the machine key). MSDN had source code for a machine key generator in some article or another. I compiled it, generated a key, specified the key in my web.config and the problem stopped.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts