Corrupt Google Chrome cache - http

I have recently experienced some strange caching issues with Google Chrome. I have a website serving several JS and CSS files with far future expiration dates. Sometimes, Chrome would fail to load one of the files (usually our biggest JS file, but sometimes another), and a page Reload / Force Reload / browser restart do not help. The only way to get rid of the problem is to completely clear the browser cache.
I used the Chrome developer tools and noticed that Chrome is requesting the file with the following headers:
If-Modified-Since:Thu, 14 Apr 2011 19:09:29 GMT
Range:bytes=41681-41681
to which the server responds with a "304 Not Modified" status. The developer tools then list the file size a 0 bytes.
The interesting thing is that 41681 is the actual length of the page (after compression), and Chrome is strangely trying to request the next byte after the end of the file.
I used the Chrome "about:net-internals" page to examine the cache and found that the file is indeed cached but is mysteriously flagged as "RESPONSE_INFO_TRUNCATED". Other than that, the cached content look perfectly fine (I compared it with a working copy of the cached file).
I have searched all over the web and the only reference I could find to such problem is on Meta: https://meta.stackexchange.com/questions/89224/does-anyone-have-problems-viewing-so-in-chrome-11
The issue reported there sounds a lot like the problem we are having but there are no conclusions other than that clearing the browser cache is a temporary solution. That post is almost two months old, and several versions of Chrome have been released since and the problem still exists.
The only relevant Chrome bug that I found is this one (reference the meta post): http://code.google.com/p/chromium/issues/detail?id=62712. However there was no activity on this bug since it has been reported.
I am very curious whether anyone else experienced similar issues, and whether anyone has any idea about what might be causing this.
Thanks,
Sagi

Related

Can't navigate through ASP.NET website while Jmeter recorder is running

The title pretty much says it all. When I'm running HTTP(S) Test Script Recorder, one particular page becomes unresponsive - when I click on something it just reloads. The recorder itself is working fine, it is recording every step. And the problem is not proxy related. I've successfully recorded other pages of the same website. When I'm not recording, there are no problems.
It's a .NET 3.5 project.
The page itself has a lot of forms, file uploads, etc, but as far as I know, it should not interfere with recording or even more - with browsing the page. When debugging the project, no breakpoints are hit, so I assume that something gets lost before reaching the server.
Browsers that I've tried: tried FF, Chrome, Edge, IE.
Tried recording the web locally and online. Same thing.
Played around (reinstalled and whatnot) with certificates, didn't help.
Has anyone encountered such a problem? What could be done to fix this? I'm more interested in finding the solution, than a way around (blazemeter, badboy). Any help would be very appreciated.
EDIT: I tried recording with blazemeter and it worked. But when looking at view results tree I noticed that the request path and parameters don't change, even when in the HTTP Request Sampler they are different. So there's no solution yet
This often happens to me and what I've found is that JMeter changes the root certificate in the bin folder every week. So usually the HTTP traffic is fine but certain HTTPS traffic won't work. So make sure that your browsers are seeing the latest JMeter certificate and not using an old one that doesn't exist anymore. On Windows, Chrome and IE use the certificates in Internet Options, while Firefox needs to have it added to it manually.
It turns out that in Test Script Recorder HTTP Sampler Settings choosing Type: Java was all that was needed. I suspect that the issue was related to file upload being involved.

Cached CSS loading error

Hey I'm working on a site that loads CSS and images that are generated server-side. Some times the images and CSS that is loaded in shows up as the incorrect template but with the correct images.
Since this template is created on the server and not on the actual page I was thinking that the web server that hosts the actual page may have a cached version of that page and may sometimes ignore the CSS and images that are generated from the main server.
In short:
Do webservers sometimes keep cached versions of page Styling?
I there an easy way to make it get the live version always?
Also this happens very infrequently and at random. It seems very hard to replicate. But I have seen it happen a few times.
Any other Ideas?
For the first answer, yes they do but only if setup that way. There is the CDN or varnish. These system are used for website with huge loads where content must be cached locally or on other server, allowing the user to visualize the cached content and not the one generated by the webserver at the moment the user requested.
Exclude this for your case then ;)
I always use chrome or firebug on firefox to debug a website.
Press F12 while in the page you want to check and, on chrome, go to "Network" tab and pin "Disable Cache".
This is incredibly handy if you refresh your page quite often and want the content not cached.
For the question itself, I don't think I/we can help you without seeing the code. But try my suggestion with F12 before.
There are two kinds of caches to think about. One of them is server cache. If you use server cache, then whenever CSS was modified, you need to empty the CSS cache if you have such a cache. If not, then you need to empty the cache, which might be painful.
As about browser cache, if you add a new parameter to your css file, then it will be loaded even if it was cached in the browser of a given user, therefore it is recommendable to add a parameter to your css file where you include it. This parameter should be either a version or a timestamp, or something uniquelly distinguishable from earlier versions. That value should be stored and you need to refresh (preferably) automatically whenever the CSS changes. The exact steps are up to you, since they differ greatly in different environments.

Website not loading CSS after refresh in Chrome

So there is this site-> http://www.raudsilla.ee
This problem occurs only in Chrome- whenever you press refresh the page loses its CSS. Weird thing is that if you look the code of both- after and before refresh, they look exactly the same. And again, only happens in chrome.
I have tried quite may things, so far no luck...
I wouldn't like to rule out anything at the moment, so any help appreciated.
The browser is outputting javascript errors, if you check the code, you're calling jQuery's document ready before the script is loaded, as it says, "$ is not defined".
After fixing the existing javascript error, it should load correctly.
I am seeing the same behavior on one of our own sites and started looking for a cause. The only conclusion I could come up with for now is that it is caused by the Mime Type of your stylesheet. This conclusion is supported by the behavior on our side.
Update:
There are three ways in which Chrome seems to load the CSS file:
As a fresh request, no cached version available, our server returns HTTP 200 OK, with content-type text/css. This works fine.
From the cache, without consulting the server. Chrome has cached content-type text/css. This works fine.
As a request with a cached version available. Our server returns HTTP 304 Not Modified, with content-type text/plain. This does not work.
After some crazy tests, I found the solution by adding "?" to the url css file.
Example: href="../_css/setup_system.css?" type="text/css"
site.css was not loading in Chrome. I added the ? in the CSS url and my styles started appearing.
Shift + Refresh solves the problem so it must be a cache problem.
PS . The site takes quite a long time to load, considered optimising?
desable addblock and refresh, if the website loaded correctly check the plugin
Open the console(ctrl + shift + c) and then network panel and check the disable cache button.

Javascript not downloading fully

Ok, this might be more of a networking question than programming but I'm not really sure what is going on here:
I'm having intermittent problems with my site where I am only partially downloading javascript documents. By intermittent, I mean that on the same browser (Safari in this case) I can view that javascript file in my browser and refresh the page and still only see the file partially downloaded, but another browser (Chrome) I see the file correctly downloaded. Clearing the browser cache has no effect either.
The odd thing is that it appears to be location specific, as when I check the site from home, still using Safari, I have zero issues. The problem also seems to be machine independent, as I also occasionally get the same javascript errors on my iPad (when at work on the same network).
I'm 100% sure it isn't a syntax error or anything with the javascript, as the file that fails most often is a minified copy of jQuery (downloaded from their site, though hosted on my site's server)
I have tried turning off mod_deflate on the idea that it might be compression that was causing the issue, but this had no effect.
I have spoken to the network admins at both my end, and the hosting server end and they claim that it isn't anything wrong with their network, though they are possibly just deflecting a complex issue.
Any ideas on how I can narrow down the issue?

IE backbutton works just once (as if browser history has just one entry)

I'm trying to fix a browser history issue. A customer of ours has a ASP.Net intranet page running for a while now. A colleague made it. Recently they asked to fix the "Back button" we made on their page (the application).
It looks at the sitemap and when clicked loads the parent page. However, in some situations I have to use "javascript:history.go(-1)". All worked fine on our test systems but when we deployed it on their test server it started to malfunctioned. We noticed that their production environment has the same problem.
Apparently all their machines (running IE) can only go back one page in the browser history. This is not intentional. We had one of their IT staff trying some other browsers and OS's. Apparently the problem (so far) only occurs when using IE. All other browsers they tested were fine. On my development system this problem doesn't occur. Also when I let someone else look at the site the problem doesn't occur either.
I have checked what their browser history length is set to and its 20 days. I tried searching here on stackoverflow but the only relevant answers concerning browser history didn't help.
How to clear browsers (IE, Firefox, Opera, Chrome) history using JavaScript or Java except from browser itself?
Also pushing the back button (the one in IE), it only works for just one page back. There is no way we can navigate more than one page back.
How can I fix this?
Server: W2k3 R2 SP2
Clients: XP I guess / IE 8 mostly
This looks very much like a local configuration problem within your customer site and therefore unlikely to be seen elsewhere, as you've proved yourself. What you need to discover is how this could be restricted and SO isn't the place for that. You might want to try posting on SuperUser for further assistance.

Resources