Solr
  1. Solr
  2. SOLR-4311

Admin UI - Optimize Caching Behaviour

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.2.1, 4.3, 5.0
    • Component/s: web gui
    • Labels:
      None

      Description

      Although both the luke and core admin handlers set http caching to false in the response headers** I believe the Cache-Control settings are ignored during ajax requests in certain browsers. This can be a problem if you're refreshing admin to get the latest do count. It can also be a problem when you compare the count of "Num Docs" on the main index page (/solr/#/CORE) vs the count on the core admin page (/solr/#/~cores/CORE). Consider that if you first visit the main index page, add and commit 100 docs, and then visit core admin the doc count will be off by 100.

      If this is an issue the ajax requests can explictly set caching to false ( http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings ) ... for example, inserting 'cache: false,' after line 91 here: https://github.com/apache/lucene-solr/blob/branch_4x/solr/webapp/web/js/scripts/dashboard.js#L91

      Tested using Chrome Version 24.0.1312.52

      1. SOLR-4311.patch
        5 kB
        Stefan Matheis (steffkes)

        Issue Links

          Activity

          Hide
          Stefan Matheis (steffkes) added a comment -

          It can also be a problem when you compare the count of "Num Docs" on the main index page (/solr/#/CORE) vs the count on the core admin page (/solr/#/~cores/CORE). Consider that if you first visit the main index page, add and commit 100 docs, and then visit core admin the doc count will be off by 100.

          This was not related to any caching headers used or not used .. just to fact the the UI internally didn't fetch the informations a second time and reused what was available from the first call. this was changed while implementing SOLR-4306

          but maybe it's general a good idea to disable caching for ajax-requests in the UI .. because it's a admin UI, not intended for public usage which may result in high traffic and you'd like to see that latest possible information.

          Show
          Stefan Matheis (steffkes) added a comment - It can also be a problem when you compare the count of "Num Docs" on the main index page (/solr/#/CORE) vs the count on the core admin page (/solr/#/~cores/CORE). Consider that if you first visit the main index page, add and commit 100 docs, and then visit core admin the doc count will be off by 100. This was not related to any caching headers used or not used .. just to fact the the UI internally didn't fetch the informations a second time and reused what was available from the first call. this was changed while implementing SOLR-4306 but maybe it's general a good idea to disable caching for ajax-requests in the UI .. because it's a admin UI, not intended for public usage which may result in high traffic and you'd like to see that latest possible information.
          Hide
          Stefan Matheis (steffkes) added a comment -

          I'll try to fix this for 4.3, we had a few other issues as well as threads on the list in the last few weeks. especially for updating to current versions, this will avoid confusion about missing cores/older versions/,,

          Show
          Stefan Matheis (steffkes) added a comment - I'll try to fix this for 4.3, we had a few other issues as well as threads on the list in the last few weeks. especially for updating to current versions, this will avoid confusion about missing cores/older versions/,,
          Hide
          Stefan Matheis (steffkes) added a comment -

          Chris Hostetter, Erick Erickson would you mind reviewing this Patch?

          The Idea behind this change: avoid using cached files, especially when upgrading versions (which happend a few times while users upgraded from 4.1 to 4.2).

          Requesting Data is covered with jQuery, it appends a timestamp at every requested url, but the js/css files don't change that often, so my idea was using this 5.0.0.2013.03.14.18.59.51 identifier, which comes from org.apache.solr.core.SolrCore.class.getPackage.

          So, finally, "the Question" ;>

          That does actually already work – just wanted to confirm it's okay introducing this, since it's (from my pov) "core-level"-information" and i'm using it here on the "top-level"

          Show
          Stefan Matheis (steffkes) added a comment - Chris Hostetter , Erick Erickson would you mind reviewing this Patch? The Idea behind this change: avoid using cached files, especially when upgrading versions (which happend a few times while users upgraded from 4.1 to 4.2). Requesting Data is covered with jQuery, it appends a timestamp at every requested url, but the js/css files don't change that often, so my idea was using this 5.0.0.2013.03.14.18.59.51 identifier, which comes from org.apache.solr.core.SolrCore.class.getPackage . So, finally, "the Question" ;> That does actually already work – just wanted to confirm it's okay introducing this, since it's (from my pov) "core-level"-information" and i'm using it here on the "top-level"
          Hide
          Steve Rowe added a comment -

          +1

          That does actually already work – just wanted to confirm it's okay introducing this, since it's (from my pov) "core-level"-information" and i'm using it here on the "top-level"

          Well, the specification version is static metadata drawn from the solr-core jar; there's no dependency on any running SolrCore. So I think it's fine.

          Show
          Steve Rowe added a comment - +1 That does actually already work – just wanted to confirm it's okay introducing this, since it's (from my pov) "core-level"-information" and i'm using it here on the "top-level" Well, the specification version is static metadata drawn from the solr-core jar; there's no dependency on any running SolrCore. So I think it's fine.
          Hide
          Stefan Matheis (steffkes) added a comment -

          I'm updating the title, because the change does not focus on specific requests.

          With the Patch, the UI uses an Identifier (Solr Package-Version) while initially loading the assets (javascript and stylesheets) and jQuery will use an timestamp for all following requests to ensure that the server doesn't deliver cached data.

          Show
          Stefan Matheis (steffkes) added a comment - I'm updating the title, because the change does not focus on specific requests. With the Patch, the UI uses an Identifier (Solr Package-Version) while initially loading the assets (javascript and stylesheets) and jQuery will use an timestamp for all following requests to ensure that the server doesn't deliver cached data.
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] Stefan Matheis
          http://svn.apache.org/viewvc?view=revision&revision=1457099

          SOLR-4311: Admin UI - Optimize Caching Behaviour

          Show
          Commit Tag Bot added a comment - [trunk commit] Stefan Matheis http://svn.apache.org/viewvc?view=revision&revision=1457099 SOLR-4311 : Admin UI - Optimize Caching Behaviour
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] Stefan Matheis
          http://svn.apache.org/viewvc?view=revision&revision=1457100

          SOLR-4311: Admin UI - Optimize Caching Behaviour (merge r1457099)

          Show
          Commit Tag Bot added a comment - [branch_4x commit] Stefan Matheis http://svn.apache.org/viewvc?view=revision&revision=1457100 SOLR-4311 : Admin UI - Optimize Caching Behaviour (merge r1457099)
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] Stefan Matheis
          http://svn.apache.org/viewvc?view=revision&revision=1457144

          SOLR-4311: Admin UI - Optimize Caching Behaviour (merge r1457143)

          Show
          Commit Tag Bot added a comment - [branch_4x commit] Stefan Matheis http://svn.apache.org/viewvc?view=revision&revision=1457144 SOLR-4311 : Admin UI - Optimize Caching Behaviour (merge r1457143)
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] Stefan Matheis
          http://svn.apache.org/viewvc?view=revision&revision=1457143

          SOLR-4311: Admin UI - Optimize Caching Behaviour

          Show
          Commit Tag Bot added a comment - [trunk commit] Stefan Matheis http://svn.apache.org/viewvc?view=revision&revision=1457143 SOLR-4311 : Admin UI - Optimize Caching Behaviour
          Hide
          David Smiley added a comment -

          +1 to get this into 4.2.1

          Show
          David Smiley added a comment - +1 to get this into 4.2.1
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] Mark Robert Miller
          http://svn.apache.org/viewvc?view=revision&revision=1458510

          SOLR-4311: move CHANGES entry.

          Show
          Commit Tag Bot added a comment - [branch_4x commit] Mark Robert Miller http://svn.apache.org/viewvc?view=revision&revision=1458510 SOLR-4311 : move CHANGES entry.
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] Mark Robert Miller
          http://svn.apache.org/viewvc?view=revision&revision=1458509

          SOLR-4311: move CHANGES entry.

          Show
          Commit Tag Bot added a comment - [trunk commit] Mark Robert Miller http://svn.apache.org/viewvc?view=revision&revision=1458509 SOLR-4311 : move CHANGES entry.
          Hide
          Uwe Schindler added a comment -

          Closed after release.

          Show
          Uwe Schindler added a comment - Closed after release.

            People

            • Assignee:
              Stefan Matheis (steffkes)
              Reporter:
              Chris Bleakley
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development