You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org> on 2008/03/18 12:49:24 UTC

[jira] Created: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Enabling HTTP Cache headers should be configurable on a per-handler basis
-------------------------------------------------------------------------

                 Key: SOLR-506
                 URL: https://issues.apache.org/jira/browse/SOLR-506
             Project: Solr
          Issue Type: Improvement
    Affects Versions: 1.3
            Reporter: Shalin Shekhar Mangar
             Fix For: 1.3


HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.

Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12606029#action_12606029 ] 

Hoss Man commented on SOLR-506:
-------------------------------

the patch seems straight forward, but the default for RequestHandlerBase should be that http caching is "ok"

Request Handlers that can't be cached will enerally be the exception to the rule (and will probably hardcode setHttpCaching(false)) ... run of the mill custom request handlers that people write which subclass RequestHandlerbase should automaticly start supporting HTTP caching, and if the users of those handlers don't wnat caching they should explicitly turn it off (not vice versa)

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>         Attachments: SOLR-506.patch
>
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar updated SOLR-506:
---------------------------------------

    Attachment: SOLR-506.patch

Syncing the patch with the trunk. No other changes to the code base.

Hoss -- Do we need anything more in this patch?

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>            Assignee: Hoss Man
>             Fix For: 1.3
>
>         Attachments: SOLR-506.patch, SOLR-506.patch, SOLR-506.patch
>
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Mike Klaas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Klaas updated SOLR-506:
----------------------------

    Fix Version/s:     (was: 1.3)

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-506:
--------------------------

    Fix Version/s: 1.3
         Assignee: Hoss Man

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>            Assignee: Hoss Man
>             Fix For: 1.3
>
>         Attachments: SOLR-506.patch, SOLR-506.patch
>
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-506:
--------------------------

    Assignee: Shalin Shekhar Mangar  (was: Hoss Man)

Shalin: I'm sorry dude ... i'm really droping the ball lately.

if you made the default behavior change then go for it.

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.3
>
>         Attachments: SOLR-506.patch, SOLR-506.patch, SOLR-506.patch
>
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599208#action_12599208 ] 

Shalin Shekhar Mangar commented on SOLR-506:
--------------------------------------------

Why didn't I think of that? :)

Yes, I agree, that should be the most painless way of implementing this.

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar updated SOLR-506:
---------------------------------------

    Attachment: SOLR-506.patch

With this patch the default behavior is to send cache headers by default for all responses. RequestHandlers which do not want responses to be cached can explicitly call SolrQueryResponse#setHttpCaching(false). Users who do not want responses for a particular request handler to be cached can add the following to the request handler's configuration section in solrconfig.xml


{code:xml}
<bool name="httpCaching">false</bool>
{code}

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>         Attachments: SOLR-506.patch, SOLR-506.patch
>
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar updated SOLR-506:
---------------------------------------

    Attachment: SOLR-506.patch

An optional boolean init parameter "httpCaching" has been added to RequestHandlerBase. This parameter should be set to true if emitting cache headers is desired. By default, emitting http cache headers is disabled. Users who desire caching must enable this for the handler they want.

The example solrconfig.xml has emitting http caching enabled for the StandardRequestHandler, MoreLikeThisHandler and SpellCheckerRequestHandler. I've removed explicit setHttpCaching calls in SearchHandler, MoreLikeThisHandler and SpellCheckerRequestHandler. If a custom request handler explictly calls the SolrQueryResponse#setHttpCaching method then it will override the per-handler configuration in solrconfig.xml

Do we need tests for this?

svn stat follows:
M      src/test/test-files/solr/conf/solrconfig-nocache.xml
M      src/test/test-files/solr/conf/solrconfig.xml
M      src/java/org/apache/solr/handler/RequestHandlerBase.java
M      src/java/org/apache/solr/handler/component/SearchHandler.java
M      src/java/org/apache/solr/handler/SpellCheckerRequestHandler.java
M      src/java/org/apache/solr/handler/MoreLikeThisHandler.java
M      example/solr/conf/solrconfig.xml

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>         Attachments: SOLR-506.patch
>
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar resolved SOLR-506.
----------------------------------------

    Resolution: Fixed

Committed revision 683121.

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.3
>
>         Attachments: SOLR-506.patch, SOLR-506.patch, SOLR-506.patch
>
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-506) Enabling HTTP Cache headers should be configurable on a per-handler basis

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599201#action_12599201 ] 

Hoss Man commented on SOLR-506:
-------------------------------

Assuming some form of SOLR-505 is committed the most straightforward way to make caching configurable per handler instance is probably to add an optional init param to RequestHandlerBase

> Enabling HTTP Cache headers should be configurable on a per-handler basis
> -------------------------------------------------------------------------
>
>                 Key: SOLR-506
>                 URL: https://issues.apache.org/jira/browse/SOLR-506
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Shalin Shekhar Mangar
>
> HTTP cache headers are needed only for select handler's response and it does not make much sense to enable it globally for all Solr responses.
> Therefore, enabling/disabling cache headers should be configurable on a per-handler basis. It should be enabled by default on the select request handler and disabled by default on all others. It should be possible to override these defaults through configuration as well as through API.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.