<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'Cache'</title><link>http://forums.asp.net/search/SearchResults.aspx?q=&amp;tag=Cache&amp;orTags=0&amp;o=DateDescending</link><description>Search results matching tag 'Cache'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: How to set Page output caching for some expiry date</title><link>http://forums.asp.net/thread/3569427.aspx</link><pubDate>Wed, 16 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3569427</guid><dc:creator>naveen_j80</dc:creator><description>&lt;p&gt;Hi Hua,&lt;/p&gt;
&lt;p&gt;I know that VaryByParams[&amp;quot;none&amp;quot;] = true will apply the same cache for all query strings. My requirement is,&amp;nbsp;my report will change based on the parameters in the URL. So&amp;nbsp;that, it will cache data based on URL that most frequently used by the users.&lt;/p&gt;
&lt;p&gt;Below is sample web application i have created and i observed same issue with it, please have a look&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;strong&gt;&lt;u&gt;Default.ASPX&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Label ID=&amp;quot;id&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;strong&gt;&lt;u&gt;Default.ASPX.CS&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Cache.SetExpires(DateTime.Now.AddDays(3));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Cache.SetCacheability(HttpCacheability.Server);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Cache.SetValidUntilExpires(true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Cache.VaryByParams[&amp;quot;*&amp;quot;] = true;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id.Text = DateTime.Now.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Request.QueryString[&amp;quot;a&amp;quot;] != null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Write(Request.QueryString[&amp;quot;a&amp;quot;].ToString());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;If we build this solution and browse as shown below&lt;/p&gt;
&lt;p&gt;URL: &lt;a href="http://localhost/WEBSITE1/Default.aspx"&gt;http://localhost/WEBSITE1/Default.aspx&lt;/a&gt;, &lt;strong&gt;Result: &lt;/strong&gt;&lt;span id="id"&gt;12/16/2009 10:56:40 AM&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;URL: &lt;a href="http://localhost/WEBSITE1/Default.aspx?a=10"&gt;http://localhost/WEBSITE1/Default.aspx?a=10&lt;/a&gt;, &lt;strong&gt;Result: 10, &lt;/strong&gt;&lt;span id="id"&gt;12/16/2009 10:59:40 AM&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;This is the expected behavior and working fine. But issue here is, it is caching this data only for 1hr or so. Not till the time we specified in the SetExpires method.&lt;/p&gt;</description></item><item><title>How to set Page output caching for some expiry date</title><link>http://forums.asp.net/thread/3559796.aspx</link><pubDate>Fri, 11 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3559796</guid><dc:creator>naveen_j80</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am using Page purout cachine in&amp;nbsp;my&amp;nbsp;asp.net&amp;nbsp;web application. I have implemented page output cachine&amp;nbsp;to cache pages at server for 3 days by using the below code&lt;/p&gt;
&lt;p&gt;Response.Cache.SetExpires(DateTime.Parse(&amp;quot;12/7/2009 11:55:00 PM&amp;quot;)); // Consider some feature date more than 3 days.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Cache.SetCacheability(HttpCacheability.Public);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Cache.SetValidUntilExpires(true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Cache.VaryByParams[&amp;quot;*&amp;quot;] = true;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When i request my page first time it is taking some time to return results to the browser and the subsequent requests for the same page is served from the cache and it is fast. But when i request same page after 3 or 4 hours, instead of serving page from server cache it is starting processing the whole page lifecylce (executing stored procedutes, binding data to gridview, etc..).&lt;/p&gt;
&lt;p&gt;The above code should cache the page for some days but it is not doing that. Is there any issue with the above code? &lt;/p&gt;
&lt;p&gt;My requirement is, i need to keep some pages in cache for 3-7 days. My requirement is, i have reports which takes long time to generate and refreshes weekly once.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks in advance...&lt;/p&gt;</description></item><item><title>Re: How to set Page output caching for some expiry date</title><link>http://forums.asp.net/thread/3561060.aspx</link><pubDate>Fri, 11 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3561060</guid><dc:creator>naveen_j80</dc:creator><description>&lt;p&gt;Hi Suresh,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your&amp;nbsp;information.&amp;nbsp;&amp;nbsp;I have done same thing but the requested page is cached for 1hr (or so) not till I specified in the SetExpires(...) method. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: slow first page</title><link>http://forums.asp.net/thread/3548213.aspx</link><pubDate>Fri, 04 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3548213</guid><dc:creator>hobeau43</dc:creator><description>&lt;p&gt;ASP.net applications can be built in 2 ways. The first is an ASP.net website the second is an ASP.net Web Application. ASP.net websites have to be compiled on the fly and save the compilation in what is called the Output Cache which explains why the first page always takes much longer than the preceding pages. The first page that is requested causes the ASP.net Website to compile and it is held in the output cache for a limited duration. For more information on this and how to control caching checkout &lt;a href="http://msdn.microsoft.com/en-us/library/aa478965.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa478965.aspx&lt;/a&gt; . An ASP.net web Application, on the other hand, is a precompiled web application. That is, it is compiled into a DLL and doesn&amp;#39;t require a recompile every time a page is requested. Another benefit of ASP.net web applications is the fact that the code is debugged (from a compiler standpoint) as it is all precompiled before uploading it to the production server. The con of using an asp.net web application is the fact that if you want to just quickly make a small change it is a bit more difficult as the entire application must be recompiled and uploaded. So it basically comes down to how you want your development model to be.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Equivalent of Page_Init in web forms for MVC</title><link>http://forums.asp.net/thread/3524123.aspx</link><pubDate>Fri, 20 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3524123</guid><dc:creator>ydesai</dc:creator><description>&lt;p&gt;Hi folks,&lt;/p&gt;
&lt;p&gt;I have an&amp;nbsp;ASP.NET MVC web app setup and I need to know&amp;nbsp;what the equivalent of&amp;nbsp;page_init&amp;nbsp;is for ASP.NET?&amp;nbsp; I need to set the application to not cache anywhere. Is the global.asax the best place for this? If so, which event? &lt;/p&gt;
&lt;p&gt;Basically, I need to put it so that everytime there is a postback, that event must be called. I am trying to turn off caching at all levels as this is a blackberry mobile app. &lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Code to add:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1);&lt;br /&gt;Response.Cache.SetCacheability(HttpCacheability.NoCache);&lt;br /&gt;Response.Cache.SetNoServerCaching();&lt;br /&gt;Response.Cache.SetNoStore();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>The local copy of this webpage is out of date, and the website requires that you download it again</title><link>http://forums.asp.net/thread/3520699.aspx</link><pubDate>Wed, 18 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3520699</guid><dc:creator>bapanpally</dc:creator><description>&lt;p&gt;hi people,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;plzz help me its very urgent,&lt;/p&gt;
&lt;p&gt;to disable the cache from client and on server side i added these lines of code, and it works fine in every broswer.&lt;/p&gt;
&lt;p&gt;my main concern is, i have a address page(when ever i visit this page it loads the page with info that is there in the database) it has a dropdown for states and textbox for zipcode, when a user enters a wrong zipcode for that state it does the server side validation and displays a serverside error message that &amp;quot;you entered a wrong zipcode&amp;quot;, after this if i enter the correct zipcode click save button it saves successfully and takes me to next page, (i can see the new data in the database table)&lt;/p&gt;
&lt;p&gt;my problem comes here,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;scenario1:(first time page loads and if i enter correct zipcode(i mean here im not entering the wrong zipcode) and click on save button)&lt;/strong&gt; it takes me to another page, if i click on browser back it displays with the new data what is there in the database i mean page loads(it goes through pageload event and populates all the fields)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;scenario2:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;if i enter wrong zipcode it gives serverside error message, after &lt;/strong&gt;i correct it and enter the correct zipcode and click on save button&amp;nbsp;it takes me to the next page,&lt;/p&gt;
&lt;p&gt;my problem comes here,&lt;/p&gt;
&lt;p&gt;when i hit the browser back button instead of loading the page with the data in the database it says &amp;quot;webpage is expired&amp;quot;. if i do the refresh then it reloads the page with new data.&lt;/p&gt;
&lt;p&gt;plzzzz help me guys, i need to fix it in production...... i&amp;#39;m not a guru in asp.net, still i&amp;#39;m in learning process .....&lt;/p&gt;
&lt;p&gt;onemorething i tried every HTTP headers&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;&amp;#39;Dim kj As String = &amp;quot;private, no-cache, must-revalidate&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size="2"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;Response.AddHeader(&amp;quot;Pragma&amp;quot;, &amp;quot;no-cache&amp;quot;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39;Response.AddHeader(&amp;quot;cache-control&amp;quot;, kj)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;Response.Cache.SetNoStore()&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;/font&gt;&amp;nbsp;i hope gud people out there helps me&lt;/p&gt;
&lt;p&gt;plzzz reply if u have a clear answer and how to do it, remember it should wrk in all browsers&lt;/p&gt;</description></item><item><title>Caching MVC Routes Using IIS 7</title><link>http://forums.asp.net/thread/3515871.aspx</link><pubDate>Mon, 16 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3515871</guid><dc:creator>kengineer</dc:creator><description>&lt;p&gt;We&amp;#39;re trying to add caching to our MVC application using the IIS 7 Caching Module.&amp;nbsp; However, the problem that we&amp;#39;re running into is that the IIS 7 Caching module asks that you provide a file extension when you register a new cache rule.&amp;nbsp; Since this is MVC, there is not file extension, just routes.&amp;nbsp; Does anyone know if it is possible to use IIS 7 caching for MVC?&amp;nbsp; We realize we can use the caching features built into Asp.Net, but we curently would prefer to control the caching at the web server.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Manage users online on social networking</title><link>http://forums.asp.net/thread/3507157.aspx</link><pubDate>Wed, 11 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3507157</guid><dc:creator>Jim77</dc:creator><description>&lt;p&gt;&lt;/p&gt;&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;I want to build a social networking.&amp;nbsp;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;I read in several places using Session to manage users online is not an effective way.&amp;nbsp;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;My question is what is the most efficient way to register users.&amp;nbsp;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;Session or Cache?&amp;nbsp;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;If using Cache, what is the best way to implement it?&lt;/div&gt;&lt;p&gt;&lt;p&gt;I want to build a social networking.&lt;br /&gt;I read in several places that using Session to manage users online is not an effective way.&amp;nbsp;Particularly for mid large proportions growing network.&lt;br /&gt;My question is what is the most efficient way to register users.&amp;nbsp;&lt;br /&gt;Session or Cache?&amp;nbsp;&lt;br /&gt;If using Cache, what is the best (and custom) way to implement it?&lt;/p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description></item><item><title>ObjectDataSource Caching</title><link>http://forums.asp.net/thread/3501725.aspx</link><pubDate>Mon, 09 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3501725</guid><dc:creator>dhavalshah</dc:creator><description>&lt;p&gt;Can u help me understand following statement&amp;#39;s meaning...&lt;/p&gt;&lt;p&gt;&amp;quot;The &lt;span&gt;&lt;span&gt;ObjectDataSource&lt;/span&gt;&lt;/span&gt; control allows 
you to cache all types of data, but you should not cache objects that retain 
resources or state that cannot be shared to service multiple requests (for 
example, an open &lt;span&gt;SqlDataReader&lt;/span&gt; 
object), because the same instance of the object will be used to service 
multiple requests.&amp;quot;&lt;/p&gt;&lt;p&gt;i m totally confused with abt statement..!!!!&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Options in caching</title><link>http://forums.asp.net/thread/3500062.aspx</link><pubDate>Sat, 07 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3500062</guid><dc:creator>Agust</dc:creator><description>&lt;p&gt;Hi guy&amp;#39;s&lt;/p&gt;&lt;p&gt;I am considering my options - any input welcome! &amp;nbsp;Here is the situation:&lt;/p&gt;&lt;p&gt;1. A rather complicated database - several queries are heavy joins. &amp;nbsp;&lt;/p&gt;&lt;p&gt;2. I have several web forms. &amp;nbsp;They do not have huge traffic - for the sake of discussion let&amp;#39;s say our goal is to have them cope well and speedy with 10 users simultaneously.&lt;/p&gt;&lt;p&gt;3. In some cases I have done some t-sql tricks to materialize views and thus speed up heavy queries. &amp;nbsp;Now - I want to move away from that - less stuff in t-sql but more stuff in my new .NET application layer.&lt;/p&gt;&lt;p&gt;4. Now - I have done page level caching (directive at the top) - and cached UserControls - it works - but the problem is that when the cache needs to be updated... well then the page is slow! &amp;nbsp;And my goal is that my users do not experience that at all. &amp;nbsp;So, I would like to find a away to have a background process update the cache so the pages do not have to.&lt;/p&gt;&lt;p&gt;5. So, all this to now share my idea:&lt;/p&gt;&lt;p&gt;The asp.net cache object is great - I have used it several times. &amp;nbsp;What if I create an asp.net page (le&amp;#39;t call it updateCache.aspx) which will take care of updating any data that I want to keep in the cache. &amp;nbsp;Then, I will have a scheduled task (which can run anywhere) and call my updateCache.aspx page at an interval of my choice - the page will go through my cached objects (I can wrap them in classes who will each now when they want to be updated) - and refresh any objects that want to be refresh.&lt;/p&gt;&lt;p&gt;Now - when my (normal) web forms are serving my users - they will not need do any heavy data loading but simply fetch from the cache.&lt;/p&gt;&lt;p&gt;So - what do you guy&amp;#39;s think? &amp;nbsp;Am I making this to complicated? &amp;nbsp;Is there another more plain way to accomplish this? &amp;nbsp;Again - my main goal is that my users never need to way for slow queries, and I do not want to use sql server to do the caching - I want to do the caching in my C# code.&lt;/p&gt;&lt;p&gt;I&amp;#39;d appreciate any input - Agust - Iceland&lt;/p&gt;</description></item></channel></rss>