Web Forms :: Caching Of Files - Noticeable Delay As Asp Recompiles
Mar 15, 2011
I have gotten confused about how page caching works in ASP.NET. Suppose a user has navigated to "home.aspx" on my website and say I release a new version of that page to the server and the user subsequently navigates to that page, he will get the updated version, is that correct? Is there ever a case where I need to be concerned that the user is NOT getting the latest version of a page(or code-behind) file? The reason I am confused is that quite sometime ago, I found the following code to put in my Page_load event to prevent page caching:
[Code]....
But the more I think about it, I cannot remember the rationale behind this. Whenever I do a release and subsequently visit my site, there is a noticable delay as ASP recompiles. So now I am wondering why the above "no caching" code would be needed or when it is appropriate to use.
View 1 Replies
Similar Messages:
Feb 1, 2011
i recently made a website and have uploaded it to a hosting server. After i had completed the website i noticed that i never added in any expiration onto the files/images plus that i dont know how to do this outside of IIS. As i dont have access to the IIS on the server i need a way of embeding code to set a short exportaion on the images and xml files cached. whats the best way of doing this?
View 5 Replies
Nov 30, 2010
i want ot clear the browser caching xml files as i am not abel to load the newly edited xml file
View 4 Replies
Dec 5, 2010
I want to use caching technique for .js,.css and images( to avoid round trips and to improve performance of page load) .So, on IIS 7 using Http Response Header, i set Content Expriation to 7 days.Now, on browser its caching which is avoiding round trips for static content ...which is good sign.Now, i modified one of the .js file and i deployed that .js file on server and due to caching my new code is not reflecting on client machines .So i tried lot of ways and here is what i tried after deployment of new .js file After deployment of new .js file
1) I manually delete all the browser cache(cookies,urls,forms,page content etc) on internet explorer
2) used ctrl + f5 to get refresh
3) again on IIS i went back Http Response Header section and set Content Expriation to never
4) stopped the website and restarted
5) on web.config file tried this only
<staticContent>
<clientCache cacheControlMode="DisableCache" />
</staticContent>
6) Also tried to set this on .aspx page
<HTML>
<HEAD>
<TITLE>---</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD>
<BODY>
7) tried to set this on .aspx.cs file
<% Response.CacheControl = "no-cache" %>>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
My target browser is IE.None of them worked,Finally i renamed my .js file to different file name and changed code to make use of that new .js file ..but no luck on this too .Because what i set intially for 7 days still my client machine remembers that.
How do i tell IIS server to refresh cached content code , when some thing got changde on .js or .cssfiles?
View 1 Replies
Mar 15, 2011
I use a Masterpage (asp.net webforms) on my site and I woluld like to implement caching of some static files, like javascript, css etc.
I've tried adding the following to my page_load (in the masterpage) but when I use Fiddler the static files are still under "no-cache".
protected void Page_Load(object sender, EventArgs e)
{
// Set cache for 1 hour on all computers and servers.
// ... Proxies, browsers, and your server will cache it.
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetMaxAge(new TimeSpan(1, 0, 0));
}
What am i doing wrong here?
View 1 Replies
Apr 26, 2010
i have some javascripts file which i need those to be chached for my website. also can i GZIP javascript files?
View 2 Replies
Jul 28, 2010
I have an ASP.NET master page which references a #include file as follows:
<!--#include virtual="/includes/scripts.inc"-->
I have modified the file /includes/scripts.inc but the changes do not show up in pages. What needs to be done so modifications will be reflected? I need to avoid the following: restarting the server restarting IIS modifying web.config (doesn't appear to have any effect)
pretty much anything that causes the app domain to restart Any other options? Is there a setting which affects how long IIS caches #include files?
View 4 Replies
Mar 18, 2010
My asp mvc site is not caching content or script files. How do I get it to cache such?
View 1 Replies
Mar 4, 2011
At some point in the last month, two web application projects that I've been working on have stopped showing updates to aspx and ascx files until IIS is restarted, or the website they belong to is reset. This seems to be very random and I can't find any reason in the web.config sections that would cause this change. What are some good places to look for a source to this issue?Current caching parts of web.config: Removing the outputCacheProfile and restarting IIS made no difference.
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="ClientResourceCache" location="None" enabled="true" duration="3600" varyByParam="*" varyByContentEncoding="gzip;deflate"/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
Commening out the staticConent and restarting also made no difference
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00">
</clientCache>
</staticContent>
<caching>
<profiles>
<add extension=".gif" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
<add extension=".png" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
<add extension=".js" policy="DontCache" kernelCachePolicy="DontCache" duration="00:01:00" location="Any" />
<add extension=".css" policy="DontCache" kernelCachePolicy="DontCache" duration="00:01:00" location="Any" />
<add extension=".jpg" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
<add extension=".jpeg" policy="DontCache" kernelCachePolicy="CacheUntilChange" duration="0.00:01:00" location="Any" />
</profiles>
</caching>
We've also tried adding .ascx and .aspx extensions with CacheUntilChange which made no difference. Other sites with these same settings aren't having the issue. Edit: Originally this state that there also was no update when the project was built, I haven't personally been able to confirm that issue but was told by another developer that was occurring.
View 2 Replies
Jun 14, 2010
I have a page with a number of user controls, In one of my user controls I have a button event. I turn on output cache for the user control that has the button and vary by control using the ID property of a hidden field control in the user control. whenever I turn on the output cache my button event doesn't fire.
View 2 Replies
May 15, 2010
how to implement caching in wcf service using System.Web.Caching
View 2 Replies
Sep 9, 2010
When running my application lately, there is a very long delay after a request is made to the server. When debugging and stepping through, the code finishes quickly and then a dialog comes up, which I'm assuming is the reason for the lag. (I've tried a series of other options including disabling usage of ViewState, disabling debugging, installing IE 8 and reinstalling the Ajax Control Toolkit.
The dialog reads as follows:
Find Source: ExtenderControlBase.cs Original Location:
C:UsersswaltherProjectsAspNetAjaxReleases30930AjaxControlToolkitSourceAjaxControlToolkitExtenderBaseExtenderControlBase.cs
I am not familiar with any user on this machine named swalther (it was reformatted rather recently) and searching my computer for this folder turns up no results.
View 1 Replies
Nov 23, 2010
i have a asp:table with 0(zero) rows and button on my page.
when user clicks the button, it add five rows into the table and show them on the page.
but i want to show each row with some delay on page.
sequence should be like this : once a rows is added then show the loading image then add another rows ,then loading Image,then add row and so on
View 3 Replies
Oct 28, 2010
When i click on any image that will have to be redirected to the corresponding page
Suppose i have 3 images and each image is linked to different page
View 2 Replies
Feb 26, 2010
So I've created a page with zones, a catalog, editor zone and property grid editor part. I have also created a simple webpart as a usercontrol and added to the declarative catalog.
In code behind of my usercontrol page I added some properties and I can edit them just fine however when I click Ok or Apply to the change of any property it takes two post backs before the changes take. So I can click Ok twice or Ok then Apply or Apply and Apply or OK then switch display modes but I will not see the changes take place inside the usercontrol until the second postback.
View 1 Replies
Aug 2, 2010
I am using Asp.net menu control, how can I delay the showing of sub menu items ?
View 7 Replies
Mar 13, 2011
How code a time delay before the next method is called? I have the following but I don't think it's waiting 10 seconds before calling CallMethod(). Thread.Sleep(10000); CallMethod();
View 2 Replies
Aug 27, 2012
How to delay the Auto postback for 10sec in textbox of asp.net.
I am filling the textbox by using autofill. I'm calling textchanged method in code behind, So I need to delay the Textbox for 10sec. Problem is when I entered single letter it is going for textchanged. so i need to delay the Autopost back
View 1 Replies
Apr 4, 2011
I have an ASP .NET page where I use jQuery. I used this function to search an element in the DOM
$(document).ready(function() {
currentID = $('#ctl00_ContentAreaPlaceHolder_hfCurrentID').val();
if (currentID != "") {
window.setTimeout(function() {
$("div[class^='element'][ID='" +currentID + "']").trigger("click");
[code]...
View 3 Replies
Apr 22, 2010
There is a website that I've programmed that sometimes takes a long time to load. I will click on a browser bookmark to load the page which should take me to a login page. The code that the Page_Loads for the MasterPage and the initial Login page contain is minimal; no service, database, etc. executions. I even just commented everything out and the problem remains. Sometimes it takes 5/10/maybe more seconds for the simple Login page to load. I'm trying to figure out what the issue is, but I'm having a hard time. When I put breaks on the Page_Loads and debug, it loads immediately. Then, seemingly randomly sometime after that, it will again load slowly.
It wouldn't seem like any of my code is the issue since, when I debug, it loads quickly. I'm not calling any services or database methods so, AFAIC, that can't be the issue. I separated all of my websites in my IIS to use their own app pool the other day so if there is a memory leak in another site, it won't affect this one. The only thing I can think of now is some issue with my network which I wouldn't have the slightest clue at starting to debug. I can have IT investigate, of course, is that is a probable cause.
View 12 Replies
Jan 7, 2010
I'm reading the stream from a FileUpload control, reading in chunks of n bytes and writing the array in a loop until I reach the stream's end.Now the reason I do this is because I need to check several things while the upload is still going on (rather than doing a Save(); which does the whole thing in one go). Here's the problem: when doing this from the local machine, I can see the file just fine as it's uploading and its size increases (had to add a Sleep(); clause in the loop to actually get to see the file being written).
However, when I upload the file from a remote machine, I don't get to see it until the the file has completed uploading. Also, I've added another call to write the progress to a text file as the progress is going on, and I get the same thing. Local: the file updates as the upload goes on, remote: the token file only appears after the upload's done (which is somewhat useless since I need it while the upload's still happening).
Is there some sort of security setting in (or ASP.net) that maybe saves files in a temporary location for remote machines as opposed to the local machine and then moves them to the specified destination? I would liken this with ASP.net displaying error messages when browsing from the local machine (even on the public hostname) as opposed to the generic compilation error page/generic exception page that is shown when browsing from a remote machine (and customErrors are not off)
View 2 Replies
Mar 21, 2011
1. How can I create a delay in C#.I know Thread.Sleep(0) but it is blocking my GUI.2. Also I need to pause the execution of the normal flow until a function return a result.
View 13 Replies
Aug 3, 2010
I am using Asp.net menu control, how can I delay the showing of sub menu items ?
The menu is handled by Menu_HoverDynamic javascript function. I am trying to settimeout this function. But the problem is the sub menu are shown and the root menu is getting hidden ?
[code]....
View 9 Replies
Jun 11, 2010
Every time my VB .NET Web Service is idle for about 30 minutes or more, the response for the next request is very slow.
View 2 Replies
Sep 27, 2010
I have an ASP.NET page with Javascript. I have some checkboxes and I want to give the user time to check and uncheck more then one box before the postback... so when the user tick/untick a check box the postback happens after 5 seconds. How can I do this? tryed different methods found online but all incomplete or wrong.
View 1 Replies