Reputation: 6290
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
Upvotes: 7
Views: 2755
Reputation: 4977
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.
Upvotes: 2
Reputation: 68400
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.
Upvotes: 6