You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2007/12/19 16:34:41 UTC

[Solr Wiki] Update of "SolrAndHTTPCaches" by ThomasPeuss

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by ThomasPeuss:
http://wiki.apache.org/solr/SolrAndHTTPCaches

The comment on the change is:
Updated configuration section

------------------------------------------------------------------------------
  
  === Configuration ===
  ==== Solr ====
- /!\ :TODO: /!\
+ You have to add some fields to the ''default'' part of your request handler configuration. When they are absent Solr switches off the generation of cache header elements.
+ 
+ {{{
+ <requestHandler ...>
+    <lst name="defaults">
+    
+       ...
+ 
+       <int name="httpCacheTTL">0</int>
+       <bool name="httpCacheForceRevalidation">true</bool>
+       <bool name="httpCacheForcePrivate">false</bool>
+    </lst>
+ </requestHandler>
+ }}}
+ 
+  * httpCacheTTL: the cache livetime of a request in seconds before a shared cache either validates the freshness with the backend server or throws the cached request away.
+  * httpCacheForceRevalidation: force the HTTP cache to strictly follow your rules if set to ''true'' or if set to ''false'' allow to serve stale requests to the client (depending of the configuration of the shared cache).
+  * httpCacheForcePrivate: If set to ''true'' indicates that all or part of the response message is intended for a single user and MUST NOT be cached by a shared cache. Private caches (for example in your browser) are still allowed to cache.
+ 
+ Solr honors following request header elements:
+  * If-None-Match
+  * If-Match
+  * If-Modified-Since
+  * If-Unmodified-Since
+ 
+ Solr emits following response header elements:
+  * Last-Modified: the time the index reader has been opened for the current index.
+  * ETag: the version of the index currently in use.
+  * Expires: Last-Modified+httpCacheTTL
+  * Cache-Control: dependent on your settings for ''httpCacheForceRevalidation'' and ''httpCacheForcePrivate''
+ 
+ <!> Solr only emits cache header elements for GET and HEAD requests. The HTTP standard does not allow cache related headers for POST requests. POST requests are not cached by standard compliant shared caches!
  
  ==== Squid Cache ====
  No special configuration is needed for [http://www.squid-cache.org/ Squid Cache]. The only thing you need to check is that the configuration parameter [http://www.squid-cache.org/Versions/v2/2.6/cfgman/cache.html cache] does not contain the \? pattern. The ''cache'' parameter tells Squid what never gets cached.