I want a particular aspx page cached in the browser. I have valid reasons for having it as an ASPX page and I need the caching on the browser.
Now, on the server cache, I can vary the caching by parameter. Does the browser too take into account parameters while caching page responses?
E.g. Will the following two responses be saves as two different cache items on the browser? http://mypage.com/page.aspx?Param=1 and http://mypage.com/page.aspx?Param=2
The basic idea behind it is the following: The browser requests some content from the web server. If the content is not in the browser cache then it is retrieved directly from the web server. If the content was previously cached, the browser bypasses the server and loads the content directly from its cache.
Use the SetNoStore() method as follows, in the ASPX page: <%@ Page Language=”C#” %> <% Response. Cache. SetNoStore(); Response.
Caching is an incredibly useful feature that works by temporarily storing data closer to the user. By distributing shared page elements such as Javascript, CSS, and images this way, a website can attain a host of benefits – all of which positively impact the underlying business.
Caching is the temporary storage of web documents such as HTML pages and images. Basically, your web browser stores copies of web pages you've visited recently to reduce its bandwidth usage, server load, and lag.
Yes, browser will treat those urls as 2 different resources so it will cache them separately (in case cache headers indicates to do so).
You could easily test it using Fiddler.
Edit 2: How to instruct browsers to ignore GET parameters when caching a resource describes a similar problem, and if you want to cache both of those pages as the same page, it may be difficult. If you want them to be different, you should be set with default behavior, but make sure that your
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="CACHE">
tag is set to explicitly tell the browser to do it.
Original answer:
You can choose if you want it to. For example, if you want those to cache differently, set an output cache with varyByParam="param":
<%@ OutputCache Duration="60" VaryByParam="Param" %>
if you do not use the vary by param option, both of those pages will cache the same. If you want to vary by multiple parameters, separate them with semicolons. If you want to vary by all params, us the * wildcard:
<%@ OutputCache Duration="60" VaryByParam="*" %>
More info on output caching: http://msdn.microsoft.com/en-us/library/y96218s9.aspx
Edit: Just re-read your question. This will cause caching on the server side, not browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With