oscache
  1. oscache
  2. OSCACHE-1

OSCache caching response from GZIP filter

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: PC

    • Issuezilla Id:
      1

      Description

      Hi

      I am working with Matt Raibles Appfuse GZIP Filter and wanted the OSCache to
      cache the GZIP response from that filter (as I want a smaler memory footprint
      and I dont want to GZIP all the time...)....

      But when I OS Cached the GZIP response, the next time it returned the response
      it was gibberish....

      I took the latest OSCache from CVS and added setContentEncoding("gzip").. on the
      response inside ReponseContent and it then worked...

      Is this a bug??

      Full trace of what I did:

      OSCache 2.0.2 did not work either ...

      I tried the latest from the CVS and it works as there is new logic in the
      CacheFilter stating:

      [oof] INFO [http-8080-Processor23] CacheFilter.doFilter(63) | GOT KEY OF
      [/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==]
      [oof] DEBUG [http-8080-Processor23] AbstractConcurrentReadCache.get(696) | get
      called (key=/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==)
      [oof] INFO [http-8080-Processor23] CacheFilter.doFilter(70) | respContent
      content type is [text/html;charset=utf-8]
      [oof] INFO [http-8080-Processor23] CacheFilter.doFilter(71) | respContent locale
      is [US]
      [oof] INFO [http-8080-Processor23] CacheFilter.doFilter(73) | <cache>: Using
      cached entry for /oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==
      [oof] INFO [http-8080-Processor23] CacheFilter.doFilter(77) | clientLastModified
      is [-1]
      [oof] INFO [http-8080-Processor23] CacheFilter.doFilter(80) | SENDING BACK A
      SC_NOT_MODIFIED

      BUT WITH THE SC_NOT_MODIFIED commented out I get the same error...

      NOTE: The same gibberish is seen on a Mozilla browser and a IE browser...

      I think it could be todo with the way it stores the content type?

      TRACE ADDING

      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(95) | calling
      flushBuffer on cacheResponse
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(101) | STATUS IS 200
      SC_OK SO CACHING THE CONTENT with key
      [/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==]
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(104) | caching response
      content with content type [text/html;charset=utf-8]
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(105) | size is [2318]
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(106) | country locale is
      [US]
      [oof] DEBUG [http-8080-Processor25] AbstractConcurrentReadCache.get(696) | get
      called (key=/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==)
      [oof] DEBUG [http-8080-Processor25]
      AbstractConcurrentReadCache.persistRetrieve(1039) | persistRetrieve called
      (key=/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==)
      [oof] DEBUG [http-8080-Processor25] Cache.getCacheEntry(611) | No cache entry
      exists for key='/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==', creating
      [oof] DEBUG [http-8080-Processor25]
      AbstractConcurrentReadCache.persistStore(1086) | persistStore called
      (key=/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==)

      AND WHEN RETRIEVING

      [oof] DEBUG [http-8080-Processor24] AuthenticatorBase.invoke(413) | Security
      checking request GET /oof/todaysRaces.html
      [oof] DEBUG [http-8080-Processor24] AuthenticatorBase.invoke(428) | We have
      cached auth type FORM for principal GenericPrincipal[mraible(admin,)]
      [oof] DEBUG [http-8080-Processor24] AuthenticatorBase.invoke(484) | Calling
      hasUserDataPermission()
      [oof] DEBUG [http-8080-Processor24] AuthenticatorBase.invoke(520) | Calling
      accessControl()
      [oof] DEBUG [http-8080-Processor24] AuthenticatorBase.invoke(538) |
      Successfully passed all security constraints
      [oof] DEBUG [http-8080-Processor24] StandardWrapper.allocate(700) | Returning
      non-STM instance
      [oof] INFO [http-8080-Processor24] CacheFilter.doFilter(59) | <cache>: filter in
      scope 4
      [oof] INFO [http-8080-Processor24] CacheFilter.doFilter(63) | GOT KEY OF
      [/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==]
      [oof] DEBUG [http-8080-Processor24] AbstractConcurrentReadCache.get(696) | get
      called (key=/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==)
      [oof] INFO [http-8080-Processor24] CacheFilter.doFilter(70) | respContent
      content type is [text/html;charset=utf-8]
      [oof] INFO [http-8080-Processor24] CacheFilter.doFilter(71) | respContent locale
      is [US]
      [oof] INFO [http-8080-Processor24] CacheFilter.doFilter(73) | <cache>: Using
      cached entry for /oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==
      [oof] INFO [http-8080-Processor24] CacheFilter.doFilter(77) | clientLastModified
      is [-1]
      [oof] INFO [http-8080-Processor24] CacheFilter.doFilter(84) | SENDING BACK
      RESPONSE SIZE IS [2318]

      ADDED THIS:

      response.setContentLength(compressedBytes.length);
      log.debug("setting Content-Encoding to gzip");
      response.addHeader("Content-Encoding", "gzip");

      AND IT WORKS:

      oof] DEBUG [http-8080-Processor25] AuthenticatorBase.invoke(538) | Successfully
      passed all security constraints
      [oof] DEBUG [http-8080-Processor25] StandardWrapper.allocate(700) | Returning
      non-STM instance
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(59) | <cache>: filter in
      scope 4
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(63) | GOT KEY OF
      [/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==]
      [oof] DEBUG [http-8080-Processor25] AbstractConcurrentReadCache.get(696) | get
      called (key=/oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==)
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(70) | respContent
      content type is [text/html;charset=utf-8]
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(71) | respContent locale
      is [US]
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(73) | <cache>: Using
      cached entry for /oof/todaysRaces.html_GET__DKDmrGxVhXXmMDcqxOikoQ==
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(77) | clientLastModified
      is [-1000]
      [oof] INFO [http-8080-Processor25] CacheFilter.doFilter(84) | SENDING BACK
      RESPONSE SIZE IS [2318]
      [oof] DEBUG [http-8080-Processor25] ResponseContent.writeTo(114) | SETTING
      HEADER CONTENT ENCODING TO GZIP

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            chris_miller
            Reporter:
            bendg25
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: