Thanks nillehammer
You are right, this is not an issue. I found that the request send is
/assets/0.1.0/core/scriptaculous_1_8_2/prototype.js?_=1310547743256
there is a timestamp after the url, and it will be always "HTTP/1.1 200 OK".
I found the problem is that I use jquery.load(), and I found a way to remove
the
timestamp by calling jQuery.ajaxSetup({ cache : true });
On Jul 13, 2011, at 5:44 PM, nillehammer wrote:
> Hi Bo Gao
>> In fact I want to load a page using ajax, but the page returned contains
>> many javascript files like
>> /assets/0.1.0/core/scriptaculous_1_8_2/prototype.js?_=1310547743256
>> This increase many requests.
>> And these javascript may be already loaded. I just want to remove these.
> That is not really an issue. You're right that the requests are made
> everytime by the browser. But as js-Files are cached, the request/response is
> different the second time. The first time your browser requests a js-File,
> the Server will deliver it with a "HTTP/1.1 200 OK ". Now the js-File is
> cached by your browser. The second time you do a request, the browser does
> not ask dumbly for the same file again but asks the server, if a newer
> version exists by sending a "If-Modified-Since:" header with the request.
> This is answered with a "HTTP/1.1 304 Not Modified ". So js-Files only go
> over the wire the first time they are requested. Later it's just checking, if
> they have been modified. This rule applies to all assets (css, gifs etc.).
>
> Regards nillehammer
>
> --
> http://www.winfonet.eu
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
--
Bo Gao
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]