![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have ASP.NET pages that I want cached on BOTH the client and server sides. I am currently setting the cache policy through code rather than OutputCache directive: HttpContext.Current.Response.Cache.SetValidUntilEx pires(true); HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.Public); HttpContext.Current.Response.Cache.SetExpires(Date Time.Now.AddMinutes(10); This seems to work fine as the pages are being cached on the client. My question is does the page actually get cached on the client AND server side. I.e. After a page is expired on the client and a request is made to the server, is a server-side cached version of the page returned? Or is the page re-executed on the server for every single client whose copy has expired? Thanks in advance! Neal |
#3
| |||
| |||
|
|
I have ASP.NET pages that I want cached on BOTH the client and server sides. I am currently setting the cache policy through code rather than OutputCache directive: HttpContext.Current.Response.Cache.SetValidUntilEx pires(true); HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.Public); HttpContext.Current.Response.Cache.SetExpires(Date Time.Now.AddMinutes(10); This seems to work fine as the pages are being cached on the client. My question is does the page actually get cached on the client AND server side. I.e. After a page is expired on the client and a request is made to the server, is a server-side cached version of the page returned? Or is the page re-executed on the server for every single client whose copy has expired? |
#4
| |||
| |||
|
|
From help: You can enable or disable page output caching for cache-capable devices |
#5
| |||
| |||
|
|
So what you're saying is that to enable Client-side (HTTP) and Server side (Application) caching I need to include the above code plus the outputcache directive? |
|
According to the documentation, I thought Response.Cache and the OutputCache were used interchangably? |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
The page will not be cached server-side unless you use the outputcache feature. The code you listed is only caching client-side. -- Ben Strackany www.developmentnow.com a href="http://www.developmentnow.com">dn</a nkranes (AT) gmail (DOT) com> wrote in message news:1100279380.242934.198830 (AT) c13g2000cwb (DOT) googlegroups.com... I have ASP.NET pages that I want cached on BOTH the client and server sides. I am currently setting the cache policy through code rather than OutputCache directive: HttpContext.Current.Response.Cache.SetValidUntilEx pires(true); HttpContext.Current.Response.Cache.SetCacheability (HttpCacheability.Public); HttpContext.Current.Response.Cache.SetExpires(Date Time.Now.AddMinutes(10); This seems to work fine as the pages are being cached on the client. My question is does the page actually get cached on the client AND server side. I.e. After a page is expired on the client and a request is made to the server, is a server-side cached version of the page returned? Or is the page re-executed on the server for every single client whose copy has expired? Thanks in advance! Neal |
#8
| |||
| |||
|
|
I hate to say it but you are correct. The only way to cache on the Server and Client seems to be using the OutputCache directive. I still think the documentation for the caching API is a bit misleading in this regard and that there should be a way to programmatically do this. Thanks for your help! |
#9
| |||
| |||
|
|
I hate to say it but you are correct. The only way to cache on the Server and Client seems to be using the OutputCache directive. I still think the documentation for the caching API is a bit misleading in this regard and that there should be a way to programmatically do this. Thanks for your help! |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |