HTTP Caching

Set HTTP caching related parameters (for proxy caches and clients).

The options below instruct Solr not to output any HTTP Caching
related headers

<httpCaching never304="true" />

If you include a directive, it will be used to
generate a Cache-Control header (as well as an Expires header
if the value contains "max-age=")

By default, no Cache-Control header is generated.

You can use the option even if you have set
never304="true"

       <httpCaching never304="true" >
         <cacheControl>max-age=30, public</cacheControl>
       </httpCaching>

To enable Solr to respond with automatically generated HTTP
Caching headers, and to response to Cache Validation requests
correctly, set the value of never304="false"

This will cause Solr to generate Last-Modified and ETag
headers based on the properties of the Index.

The following options can also be specified to affect the
values of these headers...

lastModFrom - the default value is "openTime" which means the
Last-Modified value (and validation against If-Modified-Since
requests) will all be relative to when the current Searcher
was opened. You can change it to lastModFrom="dirLastMod" if
you want the value to exactly correspond to when the physical
index was last modified.

etagSeed="..." is an option you can change to force the ETag
header (and validation against If-None-Match requests) to be
different even if the index has not changed (ie: when making
significant changes to your config file)

(lastModifiedFrom and etagSeed are both ignored if you use
the never304="true" option)

       <httpCaching lastModifiedFrom="openTime"
                    etagSeed="Solr">
         <cacheControl>max-age=30, public</cacheControl>
       </httpCaching>
CommentFileSizeAuthor
#2 3093040.patch47.1 KBmkalkbrenner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mkalkbrenner created an issue. See original summary.

mkalkbrenner’s picture

Status: Active » Needs review
FileSize
47.1 KB

  • mkalkbrenner committed 82b19b2 on 8.x-3.x
    Issue #3093040 by mkalkbrenner: Add config option to enable httpCaching
    
  • mkalkbrenner committed d867aa0 on 8.x-3.x
    Issue #3093040 by mkalkbrenner: Add config option to enable httpCaching
    
  • mkalkbrenner committed e086124 on 8.x-3.x
    Issue #3093040 by mkalkbrenner: Add config option to enable httpCaching
    
  • mkalkbrenner committed f22f205 on 8.x-3.x
    Issue #3093040 by mkalkbrenner: Add config option to enable httpCaching
    
mkalkbrenner’s picture

Status: Needs review » Fixed
botelho’s picture

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.