You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by mat0112 <el...@outlook.com> on 2013/05/17 00:58:07 UTC
Solr httpCaching for distinct handlers
Hi everybody, I would like to have distinct httpCaching configuration for
distinct handlers, i.e if a request comes for select, send a cache control
header of 1 minute ; and if receive a request for mlt then send a cache
control header of 5 minutes.
Is there a way to do that in my solrconfig.xml ?
Thanks!
--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-httpCaching-for-distinct-handlers-tp4064050.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr httpCaching for distinct handlers
Posted by Chris Hostetter <ho...@fucit.org>.
: Hi everybody, I would like to have distinct httpCaching configuration for
: distinct handlers, i.e if a request comes for select, send a cache control
: header of 1 minute ; and if receive a request for mlt then send a cache
: control header of 5 minutes.
: Is there a way to do that in my solrconfig.xml ?
: Thanks!
Unfortunatenly no.
the request handlers are agnostic to the fact that they run in a servlet
container, only the requestDispatcher has settings related to the caching
headers.
Two options you could consider depending on your end goal...
1) put a proxy in front of Solr that specifies the Cache-Control header
based on pattern matching of the URL. (There may be an existing servlet
filter you could configure in jetty for this)
2) if you already have a caching proxy in front of Solr, and your goal is
to changing how long that proxy caches the responses, you might be able to
configure it explicitly assume certain max-ages based on the request URL
(this is a very nice feature of Squid for example)
-Hoss