I looked at it in detail, and it works as following:

1. You are right, when caching is too low - then browser makes request, with
header
   If-Modified-Since. Response is 304 - that it was not modified. So the
whole resource 
   is not really downloaded, it is requested only, with short 304 response.

2. When caching time is longer, then:
     if resource is in caching time interval, then it is immediately taken
from browser cache,
     without sending a request with If-Modified-Since. So the request is not
performed, until
     caching time expires.

So the overhead is not so big. Some complex applications
may use many css and javascript files, and it is wasting of time for
requesting these never 
changing files every hour again and again. 

Also, solution is very simple, elegant and breaks no API. And the resulting
performance will 
be slightly better.
It would be good, to have a possibility to cache these never changing static
resources for 
a specified time, to prevent these needless requests.

The only thing, that is needed to do for it, is to change
WebResource#setHeaders() to take
the caching time from some settings, so it is not hardcoded and can be
configured by developer.

What do you think about it - should I create a RFE, or it is ok ?

Stefan Simik










Johan Compagner wrote:
> 
> But is it then really downloaded?
> Because the brower makes first a head request to it and that will say
> not changed
> 
> On 5/8/08, Stefan Simik <[EMAIL PROTECTED]> wrote:
>>
>> Hi boys,
>>
>> I think, there is one problem with wicket ajax javascripts - there are
>> reloading by browser every
>> hour, because the Expire header is hardcoded to 3600 seconds in
>> WebResource#setHeaders() method.
>>
>> It is really needed to repeatedly once an hour download these wicket
>> javascripts ?
>> These are static wicket javascripts, they are not subject of changes, so
>> why could they not be cached for longer time, for example - 1 week, or
>> longer.
>>
>> It would be better, if caching time should be configurable from some
>> application settings.
>> Could I create requet for improvement, or it is all ok ?
>>
>> thx
>> Stefan Simik
>>
>> //
>> I have consulted this before, but without result. So now, I am trying to
>> show
>> the problem in a simpler situation.
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Wicket-javascripts---reloading-every-one-hour-tp17117009p17117009.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-javascripts---reloading-every-one-hour-tp17117009p17125087.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to