Commits

Anonymous committed 937585e

Changes for performance reasons
Issue number: CACHE-155
Obtained from: Fernando Martins
Submitted by: Lars Torunski

  • Participants
  • Parent commits 57a43ff

Comments (0)

Files changed (1)

File src/core/java/com/opensymphony/oscache/web/filter/CacheFilter.java

                 log.info("<cache>: Using cached entry for " + key);
             }
 
+            boolean acceptsGZip = false;
             if (!fragmentRequest) {
                 long clientLastModified = httpRequest.getDateHeader(HEADER_IF_MODIFIED_SINCE); // will return -1 if no header...
 
                     ((HttpServletResponse) response).setStatus(HttpServletResponse.SC_NOT_MODIFIED);
                     return;
                 }
+                
+                acceptsGZip = respContent.isContentGZiped() && acceptsGZipEncoding(httpRequest); 
             }
 
-            respContent.writeTo(response, fragmentRequest, acceptsGZipEncoding(httpRequest));
+            respContent.writeTo(response, fragmentRequest, acceptsGZip);
+            // acceptsGZip is used for performance reasons above; use the following line for CACHE-49
+            // respContent.writeTo(response, fragmentRequest, acceptsGZipEncoding(httpRequest));
         } catch (NeedsRefreshException nre) {
             boolean updateSucceeded = false;