Uploaded image for project: 'Cache Modules'
  1. Cache Modules
  2. MGNLCACHE-46

Magnolia CacheFilter shoudn't write content twice for non-cached pages

    XMLWordPrintable

Details

    • Bug
    • Resolution: Inactive
    • Neutral
    • None
    • None
    • None
    • None
    • Linux

    Description

      For html pages that uses no-cache html headers getMaxAgeInSeconds returns 0 from ResponseExpirationCalculator. This causes double replay of content in Store & UseCache executors

      info.magnolia.module.cache.executor.Store

      if (timeToLiveInSeconds == 0) {
                  // put null to unblock the cache
                  cache.put(key, null);
      
                  // stream the response directly
                  cachedEntry.replay(request, response, chain);
                  response.flushBuffer();
      
                  return;
              }
      

      UseCache:

       if (cached != null) {
                  cached.replay(request, response, chain);
                  response.flushBuffer();
              } else {
                  // not modified (304) or nothing to write to the output
              }
      

      As a result response contains doubled data.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              tokarenko.alex@gmail.com Alexey Tokarenko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD