Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
litespeed_wiki:lslb:cache_static_files [2019/04/24 16:14]
Jackson Zhang created
litespeed_wiki:lslb:cache_static_files [2020/11/18 15:33] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== How to enable cache for static files on ADC? ====== +~~REDIRECT>​https://docs.litespeedtech.com/​products/​lsadc/cache/~~
-LiteSpeed web server and LiteSpeed ADC 's lscache engine were designed to cache dynamic pages only since static files can be served from the web server directly without best performance already and serving static files from cache will be a kind of waste resources and unnecessary steps. ​ However when ADCs are used in front of your backend servers and you may want to have CDN like feature to cache static files on ADC instead of fetching these files from backend servers every time when serving requests. ​  +
- +
-How to enable cache for static files on ADC if lscache engine only cache dynamic pages? LiteSpeed ADC has added a feature to honor browser cache headers (mod_expires directives generated browser cache header, such as "​Cache-Controlmax-age=533280"​ "​Expires:​ Sun, 03 May 2015 23:02:37 GMT" etc.) and cache such static files directly on ADC cache folder +
- +
-Make sure the virtual host cache ''​Storage Path''​ is set and ''​Respect Cacheable''​ is set to "​Yes"​ (''​Respect Cacheable''​ is enabled by default if ''​not set''​ hence you have no need to specifically set here). +
-{{ :​litespeed_wiki:​lslb:​adc-static-files-caches-0.png?​400 |}}   +
- +
-Let's look at a example css file which has ''​cache-control:​ max-age=96592000,​ public''​ and ''​expires:​ Fri, 20 Sep 2019 18:04:53 GMT''​ headers, which are set from backend web server either through LiteSpeed Cache for WordPress plugin or mod_expires directives in .htaccess. +
-{{ :​litespeed_wiki:​lslb:​adc-static-files-caches-1.png?​500 |}} +
- +
-ADC will honor such browser cache headers when seeing them and start to cache them in cache folder and serves files from ADC cache directly for furture requests. You can see ''​x-lsadc-cache: hit''​ header.  +
-{{ :​litespeed_wiki:​lslb:​adc-static-files-caches-2.png?​500 |}} +
  • Admin
  • Last modified: 2019/04/24 16:14
  • by Jackson Zhang