This is an old revision of the document!


How to enable cache for static files on ADC?

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-Control: max-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).

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.

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.

  • Admin
  • Last modified: 2019/04/24 16:14
  • by Jackson Zhang