Deleting Cache won't get latest web page - asp.net

I have a problem.
I have a mobile application (using HTML5 with localStorage). I have some web pages where theyare not cached but get the latest copy from what is on the webs server.
The problem that I am having is that one user regardless of deleting the cache still has an old copy of the program that resides on the server. Tried on a number of different browsers (Chrome, FireFox, IE) but still getting the same result. Just wondering if there is anything else I can do besides deleting the browser cache for it to realize that there is a more current version of the web page on the server

Related

Azure App Services Reloading site instead of css files

Ok odd one.
I have deployed an example angular application to Azure App Services.
This has worked.. but the styles are failing to load, and on checking
https://angularoptimized.azurewebsites.net/styles.7ade3819d0791222.css
This fails to load, it is redirecting to the main site.. not failing? I can confirm the file exists. And in case it matters, there are also compressed versions available on the server so wondering if this is being interpreted weirdly??
If checked in a browser, its not identifying the call as a style sheet either. Any ideas?

Stylesheet fails to load on first request after deployment

After a new version of the site is deployed, the first time every user opens the site, none of the site's stylesheets are downloaded or load. Refreshing the page downloads and loads the stylesheets and then the site looks fine until the next time we do a deployment.
The site is a .NET 4 MVC website deployed to Windows Server 2008 R2 running IIS 7. The site is deployed using a publish package created through VS10 and imported into IIS.
Most users access the site using IE10 or 11 and some earlier IE users. None of the pcs available to test on have Firefox or Chrome, so I haven't been able to test whether the site's styles show up on first load in other browsers. Locally, the site displays correctly regardless of the browser and version used. There are no server errors or browser errors reported.
The styles are Bootstrap, and a custom site stylesheet.
Is the CSS reference rendering into the page source correctly? We have had similar issues with our .Net 4.0 CMS where dynamically populated references failed to populate under load because the response was getting flushed before update. Unfortunately we had to revert to static reference in master pages due to time constraints.

HTML5 Offline - how to prevent browser from using cached page?

I work on a web application in ASP.NET and HTML5. I have a simple page Default.aspx. In its Page_Load handler I call 'Response.Redirect("xxx.aspx"). I also defined a manifest file, Default.appcache as I want my application to work offline (in such case I javascript methods are used for redirection). Browser cached the page as expected but a problem occured - even though server is online, browser uses the cached page. When user enters Default.aspx no call is sent to server. How can I prevent this behavior? I would like the browser to send a normal request to IIS if it is online and use cached page only when server doesn't respond.
I would be grateful for all suggestions.
You can't, pages in the cache are always served from the cache. The only way to update them is update the manifest and force new versions to be downloaded.
If you want one page to be served when online and a different one when offline then you should investigate the FALLBACK section of the manifest. Note that the page which references the manifest is always cached, so you need to set the fallback up on a different pair of pages.

ASP.NET webforms app sometimes fails to load until cookies deleted

I'm developing an ASP.NET 4 webforms app on my Windows 7 PC. I'm running VS2010 and IIS7.5.
I have a weird problem where after a few page loads (anywhere from 1 to 20ish) I get NO response from IIS. I can't even hit a breakpoint in Application BeginRequest, I just get nothing. But, if I delete all cookies from the browser for the development domain, the website will load perfectly again for a few more requests.
This happens in all browsers I have installed (IE9, Firefox, Chrome, Safari, Opera).
However, if I deploy the app to our hosted server, all works fine.
Anyone had this issue before?
Many thanks for any help you can provide.
After the comments I add for reference here an answer.
This is an issue when you place too large cookie to the browser and browser can not handle them.
The reason that is play here, not play there maybe because of the data that you have type on it and save on cookies.
You can search for cookie limits on the internet and for different browsers. For ie for example http://support.microsoft.com/kb/306070
Try to keep the cookie size as low as you can.
From antmx
For reference, here is what I changed in web.config to fix this problem.
<roleManager cacheRolesInCookie="false" />
Note, though, that now a user's roles will be read from the database each time they're needed, which could cause a performance issue. (I am not think that there is any performance issue and is more secure this way)

not loading script files (javascript, scriptresource, css, and any other included script files) intermittenly

I got this very odd situation on my application which not all the time most of scripts I include in the <head> is not loaded, but some times they are. If I will refresh the page (either f5 or refresh button), sometimes it loads sometimes it's not. But if I enter the URL directly to the address bar, the page loads as expected. This happens not only in one page but in most pages but intermittently. My application is deployed on my local IIS version 5.1 (i'm using XP SP3). Mostly this situation happens if I rebuild my solution or I restart my IIS to refresh my IIS cache or to restart my Application. My guess is that my IIS don't have enough memory to process all the request at a time that it forgot to load all of the included scripts. Can anyone shed some light on where I should look to solve this kind of problem? At first it only happen on my machine, but lately I've noticed that it happens to our dev server also, I don't want it to go our test server or worse at the production server.
EDIT:
Here's how I determine the scripts that are not loaded.
I don't have any changes on any scripts, css what so ever that is directly seen on the client side. I only change a bit of code behind logic that wont change a bit on what the client user can see on UI. When I build it and test it on browser directly using the local IIS, my display has been corrupted, some scripts will not function and some page methods errors shown.
If I refresh the page, once or many times, the page will displace normally. As soon as I notice this, I already know that this is a cache problem.
I've used firefox and seen the same thing, so I've viewed the source. At first I didn't notice anything suspicious and everything seems normal until I clicked each include on the pages, css and scripts. Some of it are not read instead it returned an html containing The page cannot be displayed, There are too many people accessing the Web site at this time.
Once I noticed the return of some include scripts and css on the source which they return The page cannot be displayed, There are too many people accessing the Web site at this time. which is 403 error or Access forbidden, I wonder why access is forbidden, so I've done some research on my own and found out that IIS 5.1 on XP system only allows a maximum of 10 concurrent keep-alive connection, so if the page is not cached yet or part of the page, it requests to the IIS and there are times that the first request is not done and another request is being made which stuck up to 10 concurrent request, the IIS will return an 403 error to those last requests until, the first request is done and opens another connection.
For IIS5.1 in XP system, I can't do anything but to accept the fact that it only accepts 10 concurrent request, but for IIS6+, I found this article that it can handle up to 3,000 concurrent connections easily and could go more without limits depending on the Hardware resource of the machine, and some tweaks on the settings.

Resources