Could some body explai开发者_开发技巧n me caching in asp.net?
I am just confused on the point that in caching a compiled page is kept on the server of a executed page which is reused on same page request.
I read on the Internet but theory doesn't clear my doubt regarding how exactly the caching works.
So please enlighten me on this. Please provide me some solutions of your own instead of providing any links.
When you compile your page, the output is not a simple html page for the client. Instead the output is a block of code that the server runs in order to service related requests.
On the other hand, caching takes some or all of the output (frequently read-only; often html) of the code that the server ran and saves that output in memory. Thus the next time the server sees the same request, it can simply pull the related output from memory instead of repeatedly executing the same code.
For simple tasks, the savings here is minimal, but for complex tasks where the server does a lot of processing to generate the corresponding output, this can produce very big performance improvements. It is also worth noting that caching of data that changes very frequently isn't likely to be very worthwhile, since the cached output becomes outdated as soon as the corresponding data changes.
精彩评论