Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25385

Review all Web UI dynamic and static resources http caching strategy

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.10
    • Fix Version/s: 10.3
    • Component/s: Web Common, Web UI
    • Release Notes Summary:
      Improved caching strategy
    • Browser:
    • Upgrade notes:
      Hide

      Note that filterConfig <pattern> contributions now match the full path and query parameter of the URI (previously the query parameter was not included).

      Thumbnails, blobs and nxfile resources can have the doc changeToken appended as a query params for optimized http caching.

          <filterConfig name="cachedBPR" cached="true" private="true" cacheTime="31536000" transactional="true">
            <!-- if url contains doc changeToken: approximately one year -->
            <pattern>${org.nuxeo.ecm.contextPath}/.*/@(blob|preview|rendition).*\\?.*changeToken=.+</pattern>
          </filterConfig>
         
          <filterConfig name="cachednxfile" transactional="false" synchonize="false" cached="true" private="true" cacheTime="31536000">
            <!-- if url contains doc changeToken: approximately one year -->
            <!-- transaction is manually handled in DownloadServlet -->
            <pattern>${org.nuxeo.ecm.contextPath}/nxfile/.*\\?.*changeToken=.+</pattern>
          </filterConfig>
      

      Otherwise, we let eTag play.

      Show
      Note that filterConfig <pattern> contributions now match the full path and query parameter of the URI (previously the query parameter was not included). Thumbnails, blobs and nxfile resources can have the doc changeToken appended as a query params for optimized http caching. <filterConfig name= "cachedBPR" cached= " true " private = " true " cacheTime= "31536000" transactional= " true " > <!-- if url contains doc changeToken: approximately one year --> <pattern>${org.nuxeo.ecm.contextPath}/.*/@(blob|preview|rendition).*\\?.*changeToken=.+</pattern> </filterConfig> <filterConfig name= "cachednxfile" transactional= " false " synchonize= " false " cached= " true " private = " true " cacheTime= "31536000" > <!-- if url contains doc changeToken: approximately one year --> <!-- transaction is manually handled in DownloadServlet --> <pattern>${org.nuxeo.ecm.contextPath}/nxfile/.*\\?.*changeToken=.+</pattern> </filterConfig> Otherwise, we let eTag play.
    • Sprint:
      nxGang Sprint 10.3.1, nxGang Sprint 10.3.2, nxGang Sprint 10.3.3, nxGang Sprint 10.3.4
    • Story Points:
      2

      Description

      Since NXP-23026 and https://github.com/nuxeo/nuxeo/commit/d13bb493d6f17f4cb4abc4d9fb61c7ff08b7fbe6, the server sends in all response the no-store http header which prevents the browser from leveraging the eTag.

      As a direct results, Web UI is fetching and refetching far too many resources such as thumbnails, previews, and blob throuhg nxfile servlet path (for pdf viewer for instance).

      I understand we don't want to display obsolete resources when for instance we edit a document to change its main blob, we want the change to be reflected asap in the preview (and do not display the old preview).

      However, since the tomcat sends the eTag of the resource, we should make the browser leverage the If-None-Match http header to check if its locally cached resource is up to date and only download it again if obsolete.

      Setting cache to true but cacheTime to 0 will make the browser send the If-None-Match: xxxxx where xxxx is the previously received eTag.

      Useful reading BTW: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 days, 1 minute Original Estimate - 2 days, 1 minute
                  2d 1m
                  Remaining:
                  Time Spent - 2 days Remaining Estimate - 1 day, 1 minute
                  1d 1m
                  Logged:
                  Time Spent - 2 days Remaining Estimate - 1 day, 1 minute
                  2d