This is an old revision of the document!
Apache configuration directives
LiteSpeed’s Apache-style configuration directives must be nested in <IfModule LiteSpeed>
and </IfModule>
tags. For example:
<IfModule LiteSpeed> CacheEnable public / CacheRoot c:/cacheroot CacheMaxExpire 604800 </IfModule>
CacheEnable
syntax: CacheEnable [cache_type] [url-string]
The CacheEnable
directive instructs LiteSpeed Web Server to cache urls at or below url-string. Both public and private caches can be enabled based on the value specified with the cache_type argument.
# Enable public cache CacheEnable public /
# Enable private cache CacheEnable private /
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.
# Disable public cache CacheDisable public /
# Disable private cache CacheDisable private /
CacheRoot
syntax: CacheRoot directory
The CacheRoot
directive defines the name of the directory on the disk to contain cache files.
CacheRoot c:/cacheroot
CacheMaxFileSize
syntax: CacheMaxFileSize bytes
The CacheMaxFileSize
directive sets the maximum size, in bytes, for an object to be considered for storage in the cache.
CacheMaxFileSize 64000
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.
CacheIgnoreCacheControl On
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.
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.
CacheMaxExpire 604800
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:
CacheLookup public off
And then turn it on at a per-site basis with the following directive:
CacheLookup public on