I have a PNG file called icons.png hosted on an Apache server. Basically this file is a combination of other small image elements ( CSS Sprite ). This file loads with a normal response of 200 OK when the page loads for the first time.
After loading the page; There are some freezing links on which the user prompt is launched. This tooltip displays part of the image from the icons.png file as the background image of some HTML elements.
For example, the HTML code is as follows:
jQuery(".profile").tipTip({delay: 200, defaultPosition: "top", content: "<a href='#' style='width: 32px; height: 32px; display: block; background: url ( images / icons.png) no-repeat -200px -64px'></a>"});
[There are several more places in the HTML file where icons.png was specified)
Now every time I put a link to a link, a tooltip appears, but at the same time the browser sends an HTTP request to the server for the icons.png file. And the response code from the server as 304 is not changed .
Although the contents of the file do not load, the overhead of sending headers ( about 166 bytes ) still exists every time, which in turn causes a delay of 1.5 s (I am on a black slow connection). During this 1.5 s period, the tooltip has no background image, and suddenly the image appears out of nowhere.
Here are some screenshots.



As far as I know, when the resource was selected, the browser should store it in the cache and extract from it where necessary, instead of asking the server several times .
As I found out, the server doesn't send the Expires header or Cache-Control along with the content. I'm not sure if this could be the reason for this exceptional Chrome behavior. Any suggestion is much appreciated.
PS: The application is hosted in the Heroku hosting environment. I am using Firefox 15.0 and Chrome version 21.0.1180.89 on Ubuntu 12.04 x86_64.