Hi,
I am working on a webapp with jquery ,rgraph,and bootstrap(for mobile device and desktop browsers).
The static files(js ,css ,image,html) are quiet large and they will not change from time to time. So it's important to cache them longer in client browser.
I've try to minify Js and css files with JsCompressor(more than 700kb in total).
Tested in Chrome v35 Desktop:
When static files are placed under /www folder,after first load,js files are loaded from cache(Status Code:304 Not Modified). The repsonse headers are :
No expire time is implemented by server. To make cache available longer,I try to set the cache-control headers(max-age ,expire)for js files (demo attached).
Reference:http://www.web-caching.com/mnot_tutorial/how.html
Js files are loaded successfully. But each time when I refresh the page, js files are reloaded from server( Status Code:200 OK ) instead of from cache(Status Code:304 Not Modified).
Moreover,Pre-compression of static files will greatly reduced file size,but currently not supported.
Please give me some tips on how to cache static files or reduce the files size.
Thanks,
bz
I am working on a webapp with jquery ,rgraph,and bootstrap(for mobile device and desktop browsers).
The static files(js ,css ,image,html) are quiet large and they will not change from time to time. So it's important to cache them longer in client browser.
I've try to minify Js and css files with JsCompressor(more than 700kb in total).
Tested in Chrome v35 Desktop:
When static files are placed under /www folder,after first load,js files are loaded from cache(Status Code:304 Not Modified). The repsonse headers are :
B4X:
HTTP/1.1 304 Not Modified
Server: Jetty(9.1.z-SNAPSHOT)
No expire time is implemented by server. To make cache available longer,I try to set the cache-control headers(max-age ,expire)for js files (demo attached).
Reference:http://www.web-caching.com/mnot_tutorial/how.html
Js files are loaded successfully. But each time when I refresh the page, js files are reloaded from server( Status Code:200 OK ) instead of from cache(Status Code:304 Not Modified).
Moreover,Pre-compression of static files will greatly reduced file size,but currently not supported.
Please give me some tips on how to cache static files or reduce the files size.
Thanks,
bz