0

We recently put live EPiServer output caching, this works fine locally and on our staging sites. For some reason since going live yesterday pages don't seem to stay in the cache for long, if at all. I can't see any obvious reason for this aside from genuine traffic?

To implement caching I added [ContentOutputCache] to the get methods of certain controllers. Then updated the Application Settings with the following:

uiUrl="~/EPiServer/CMS/" httpCacheExpiration="12:0:0" httpCacheVaryByCustom="path" httpCacheVaryByParams="id,epslanguage"

Has anyone seen anything like this before. I can't figure out why the cache keeps being dropped. Interestingly chrome tells me that the content is coming from the cache but the page load time is upwards of 20 seconds at times ... other times it's instant (when the caching is working).

I am not logged in to the CMS and no one is publishing anything.

Please let me know if you need any more info as always any help greatly appreciated on this.

Thanks,

Dan

  • A crude but effective way of manually checking if the request indeed hit the server is to output a timestamp in the markup, and then simply refresh the page a couple of times. :) There's nothing Episerver-specific about the output cache, so any resources on IIS will help you. – Ted Nyberg May 10 '16 at 12:13
  • Thank you that is a good idea :D I'll give that a try. – Daniel Pickford May 10 '16 at 13:11
  • If you look at the markup of [our site](https://tedgustaf.com) you'll actually see we do the same thing, with an attribute called `data-page-generated` on the `html` tag. :) That was added when we were investigating a previous output caching bug in Episerver where the output cache wasn't cleared on publish. – Ted Nyberg May 10 '16 at 14:24
  • Thanks @TedNyberg did you also set the httpCacheVaryByParams to be "id,epslanguage"? – Daniel Pickford May 10 '16 at 16:17
  • After adding a time stamp it's become clear that it's just one page that seems to keep dropping out of the cache. Unfortunately for me this is the main page I wanted caching! I can't see why no one is publishing anything. – Daniel Pickford May 10 '16 at 16:55
  • I found what was clearing the cache. Whenever anything is uploaded to the media folders it publishes causing the cache to drop. This has lead to my follow up question. http://stackoverflow.com/questions/37169674/stop-episerver-clearing-output-cache-on-publish – Daniel Pickford May 12 '16 at 08:10

0 Answers0