1

Just a quick question so I full understand this better, the way I understand it currently is if you set a page to be cached the HTML generated is essentially saved and then reserved.

This means no code behind on that page is run until the cache expries and regenerates. Also, if say for example I have a dynamically generated date stamp, this will always be the date the cache was generated.

Is this correct?

2
  • I think you got it right, provided there's not "vary by" parameters and you don't handle any authentication or authorization in your page. If you need to update a datestamp, then ASP.NET provides a way around this. Commented Apr 8, 2011 at 8:36
  • You can use output caching but still leave a 'donut hole' part of the page that will still run on every page request, but outside the usual page lifecycle. See stackoverflow.com/questions/3318570/… Commented Oct 21, 2011 at 23:10

2 Answers 2

3

Read the artice about caching. If you want to fully understand Http Caching, you should also read Caching In Http. And the answer is yes, once the page is saved in cache, no code behind is run before it's regenerated. Also, dynamically generated content will stay in cached page as static

Sign up to request clarification or add additional context in comments.

Comments

1

Yes, but you can flag some portions of code or some controls to be rewrited. You can catch only some controls or all controls except one...

Catch the data from database or some collections...

Is a lot flexible.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.