Saturday, June 26, 2010

Re: remove old javascript file

Its obviously a great idea to cache, and GWT makes it really easy to do that.

There are in general three buckets of cache settings that you should know about - 
  1. Cache Forever -  Any file that has the extension .cache.xxx falls in this category. It is safe to set a far-in-the-future expires header. If this file ever changes, GWT guarantees it will generate a completely different file name.
  2. Never Cache - The bootstrap <module-name>.nocache.js, and your host html/jsp page falls under this category. The browser should never cache these files, and you should specify the right http headers to ensure this.
  3. Cache for sometime - Every other file falls under this category. In general, you should use ClientBundle so that files don't end in this category. GWT generated js/html files will never come under this category. You can choose to set an expires header ranging from a few hours to a few days, depending on how frequently you change your code. 
This thread on stackoverflow has the necessary http header details. This is GWTs official documentation that explains the meaning of all these weird ile extensions.

--Sri


On 27 June 2010 03:44, bhomass <bhomass@gmail.com> wrote:
do you mean to set a limited cache lifetime or to not cache at all?

I do normally want the javascript files to be cached for performance
purposes.

On Jun 17, 10:02 pm, Sripathi Krishnan <sripathi.krish...@gmail.com>
wrote:
> No, you can't do that. But if you set appropriate cache headers, there is
> never a need to delete old files.
>
> --Sri
>
> On 18 June 2010 06:10, bhomass <bhom...@gmail.com> wrote:
>
> > is there any way to programmatically get user browser to delete all
> > its cached javascript files in order to push down new ones?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-toolkit@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscribe@googlegroups.com<google-web-toolkit%2Bunsubscribe@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate