Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:cache:developer_guide:directives [2017/02/14 21:45]
George Wang [CacheRoot]
litespeed_wiki:cache:developer_guide:directives [2020/07/31 19:37] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== Apache configuration directives ====== +~~REDIRECT>https://docs.litespeedtech.com/lscache/devguide/controls/~~
-LiteSpeed’s Apache-style configuration directives must be nested in ''<​IfModule LiteSpeed>''​ and ''</​IfModule>''​ tags. For example: +
- +
-<​code>​ +
-<​IfModule LiteSpeed>​  +
- ​CacheEnable public ​/ +
- ​CacheRoot c:/cacheroot +
- ​CacheMaxExpire 604800 +
-</​IfModule>​ +
-</​code>​ +
- +
-===== CacheEnable ===== +
-**syntax:** ''​CacheEnable [cache_type] [url-string]''​\\ \\ +
-The ''​CacheEnable''​ directive instructs LiteSpeed Web Server to cache urls at or below url-stringBoth public and private caches can be enabled based on the value specified with the cache_type argument\\ +
-<​code>​ +
-# Enable public cache +
-CacheEnable public ​/ +
-</code> +
-<​code>​ +
-# Enable private cache +
-CacheEnable private ​/ +
-</code> +
- +
-===== CacheDisable ===== +
-**syntax:** ''​CacheDisable [cache_type] [url-string]''​ \\ \\ +
-The ''​CacheDisable''​ directive instructs LiteSpeed Web Server to not cache urls at or below url-string. Both public and private caches can be disabled based on the value specified with the cache_type argument. \\ +
-<​code>​ +
-# Disable public cache +
-CacheDisable public / +
-</​code>​ +
-<​code>​ +
-# Disable private cache +
-CacheDisable private / +
-</​code>​ +
- +
-===== CacheRoot ===== +
-**syntax:** ''​CacheRoot directory''​ \\ \\ +
-The ''​CacheRoot''​ directive defines the name of the directory on the disk to contain cache files. \\ +
-<​code>​ +
-CacheRoot /​dev/​shm/​cacheroot +
-</​code>​ +
- +
-===== CacheMaxFileSize ===== +
-**syntax:** ''​CacheMaxFileSize bytes''​ \\ \\ +
-The ''​CacheMaxFileSize''​ directive sets the maximum size, in bytes, for an object to be considered for storage in the cache. \\ +
-<​code>​ +
-CacheMaxFileSize 64000 +
-</​code>​ +
- +
-===== CacheIgnoreCacheControl ===== +
-**syntax:** ''​CacheIgnoreCacheControl On|Off''​ \\ \\ +
-Ordinarily, requests containing a ''​Cache-Control:​ no-cache''​ or ''​Pragma:​ no-cache''​ header value will not be served from the cache. The ''​CacheIgnoreCacheControl''​ directive allows this behavior to be overridden. ''​CacheIgnoreCacheControl On''​ tells the server to attempt to serve the resource from the cache even if the request contains no-cache header values. Resources requiring authorization will //never// be cached. \\ +
-<​code>​ +
-CacheIgnoreCacheControl On +
-</​code>​ +
- +
-<​code>​ +
-Warning: +
-This directive will allow serving from the cache even if the client has requested that  +
-the document not be served from the cache. This might result in stale content being served. +
-</​code>​ +
- +
-===== CacheMaxExpire ===== +
-**syntax:** ''​CacheMaxExpire seconds''​ \\ \\ +
-The ''​CacheMaxExpire''​ directive specifies the maximum number of seconds for which cacheable HTTP documents will be retained without checking the origin server. Thus, documents will be out of date at most this number of seconds. This maximum value is enforced even if an expiry date was supplied with the document. \\ +
-<​code>​ +
-CacheMaxExpire 604800 +
-</​code>​ +
- +
-===== CacheLookup ===== +
-**syntax:** ''​CacheLookup public on|off''​ \\ \\ +
-The ''​CacheLookup''​ directive instructs LiteSpeed Web Server on whether or not to check public cache. Typically, on a web server level, you want to set this off with the following directive: \\ +
-<​code>​ +
-CacheLookup public off +
-</​code>​  +
- +
-And then turn it on at a per-site basis with the following directive: \\ +
- +
-<​code>​ +
-CacheLookup public on +
-</​code>​+
  • Admin
  • Last modified: 2017/02/14 21:45
  • by George Wang