I have done that....
Cons:
1. URLs do get cached by browser.
2. Parameters do not change as long as application is not restarted....
(which is acceptable)
Negs:
1. Browser still sends separate request to check if file was updated. It
does get 304 evrytime though.
2. You can not specify your own header information. IE supports following
header "Cache-Control: max-age=2592000;post-check=36000,pre-check=432000"
this eliminates #1. It's like browser is guaranteed that file will not be
changed for that much of time. Google post-check/pre-check..
Unclear:
Still not clear what would be better (in terms of performance). Hit file
system for static .js file or hit .NET runtime to get resource with
WebResource.axd.
Thanks
George.
> I have done that....
>
> Cons:
I think you mean 'Pros', right?
> 1. URLs do get cached by browser.
> 2. Parameters do not change as long as application is not restarted....
> (which is acceptable)
>
> Negs:
This would be the 'Cons'
> 1. Browser still sends separate request to check if file was updated. It
> does get 304 evrytime though.
Does the request include the pragma: no-cache header. If so you're using
refresh. When using refresh IE will push requests for other static
resources through the cache with the aforementioned header. Also by default
it typically will make use the same approach when first fetching the page in
a session. Therefore you will see this if you close and re-open IE.
Try just navigating to it from another page and see what happens.
> 2. You can not specify your own header information. IE supports following
> header "Cache-Control: max-age=2592000;post-check=36000,pre-check=432000"
> this eliminates #1. It's like browser is guaranteed that file will not be
> changed for that much of time. Google post-check/pre-check..
Yes any change to the source would result in an new URL (it what I call an
immutable URL) so any single URL will only ever be associated with specific
content.
> Unclear:
> Still not clear what would be better (in terms of performance). Hit file
> system for static .js file or hit .NET runtime to get resource with
> WebResource.axd.
Well the static is always going to be quicker but by the looks of it not by
any amount that matters even in extreme circumstances.

Signature
Anthony Jones - MVP ASP/ASP.NET
George Ter-Saakov - 15 Feb 2008 21:12 GMT
1. You got it right about Pros and Cons..... I messed up there :)
2. About 304... You right, I did the test and it turned out browser does not
hit server each time. Only if it was closed and reopened (or F5 was hit).
---------------------------------------------------
With Cache-Control: max-age=2592000;post-check=36000,pre-check=432000 it
does not even send request when it was closed and opened again.
And if you hit F5 then IE rechecks (and caches) files in background thread.
That makes page to appear instantly....
To see it in a work hit this url (open it, IE will cache images, close IE
and open this URL again).
http://www.mspiercing.com/Group/belly-button-rings-38.aspx?SortType=0
I am using the Cache-Control for pictures of items. You will notice that
page just instantly appears (when you hit it second time) with images (it
has a lot of images) as opposed to "conventional" page where IE will show
empty spot until it sends request to the server (even though images were
cached) and gets 304.
I wish I could add those headers to WebResource.axd.
Too bad only IE supports it good this is that IE is about 80% of all
browsers:)
Thanks
George.
>> I have done that....
>>
[quoted text clipped - 41 lines]
> by
> any amount that matters even in extreme circumstances.