What is the difference between cash and amp; Permanently cache the GWT framework image files in the browser .cache. Pattern has been renamed and I have read permanently the images in the Google Web site in GWT, to configure them permanently for the caching of the app-server. But I do not know exactly how to do this. The images of my website will never be changed and I want to always cache them without checking any version (for best performance) Your Honor
ClientBundle introduced in GWT 2.0
It is being said that, GWT introduces a concept in which they are called correct caching. This works by splitting your application into several files, such as .cache.html and md5 partly changes when your app code or resource changes. Then there is a bootstrap script, in which the correct & lt; Md5 & gt; .cache.html contains the logic for viewing the file and load it Bootstrap should not be cached.
In your app server, you will need to configure it like this (in this case Apache)
& lt; Files *. Nocache * & gt; Ends the default "Access" & lt; / Files & gt; & Lt; Files *. Cache. * & Gt; Ends Default "Now plus 1 year" & lt; / Files & gt; In this case it is set to cache for one year, as far as I know there is no setting to cache forever, its only a very high The end time is up.
Tommak caching
In case of Tomcat, as far as I know there is no cache control, it should be done manually by setting appropriate HTTP header. It can be automated using filters.
/ * Please do not use it in production! * / Public class cachefilter implements filter {public zero doFilter (universaluquate request, circlet response race, filter chain chain) throws IOException, ServletException {HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; // Cache everything for one year's response. AddHeader ("Cache-Control", "Max-Age = 31556926"); Chain.doFilter (request, response); } Public Zero Init (FilterConfig filterConfig) {this.fc = filterConfig; } Public Zero Blast () {this.fc = null; }} Then, map the filter into a tomcat or derivative (like a glassfish), in web.xml:
& lt; Filter & gt; & Lt; Filter-name & gt; CachingFilter & lt; / Filter-name & gt; & Lt; Filter range & gt; CacheFilter & lt; / Filter range & gt; & Lt; / Filter & gt; & Lt; Filter-mapping & gt; & Lt; Filter-name & gt; CachingFilter & lt; / Filter-name & gt; & Lt; URL pattern & gt; * Cache * & lt; / URL pattern & gt; & Lt; / Filter-mapping & gt;
Comments
Post a Comment