3

I have an ASP.Net Web Forms application. The blog post "CacheCow Series - Part 0: Getting started and caching basics" mentions that Output Caching uses HttpRuntime.Cache behind the scene -hence not HTTP caching. The request reaches the server and cached response is sent from the server (when the valid cached output is avaialble on the server). So the entire content is sent across the wire.

Is there any HTTP Caching available for ASP.Net Web Forms (where response content is not sent from the server, if cache is valid; but the client takes it from it's HTTP Cache after getting validity information (only) from the server)?

REFERENCES

  1. Is page output cache stored in ASP.NET cache object?
  2. Things Caches Do - Ryan Tomayko - 2ndscale.com/
2

1 Answer 1

1
+50

Actually the OutputCache directive is used for both Client as Server side caching. When you set the Location of that directive to Any, Client, Downstream or ServerAndClient, proper cache response headers are set such that browsers or proxies won't request the same page again and serve the cached version of your page. But keep in mind that those clients are free to request those pages again.

Location options with their Cache-Control headers after setting directive: <%@ OutputCache Location="XXX" Duration="60" VaryByParam="none" %>

  • Client: private, max-age=60
  • Downstream: public, max-age=60
  • Any: public
  • ServerAndClient: private, max-age=60
  • Server: no-cache
  • No output directive: private
Sign up to request clarification or add additional context in comments.

2 Comments

Please read max-age. I guess, all the approaches you mentioned tells the client to consider data as stale after a time period. It doesn't validate whether the data actually changed by sending a request to server, using a mechanism like ETag .
No, it doesn't do ETag validation out of the box. IIS does it for static content, but ASP.NET webforms not. But please refrase your question what you actually are looking for.

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.