oschaaf commented on issue #1556: Combined css returns truncated, mis-encoded 
body on cache hit
URL: 
https://github.com/apache/incubator-pagespeed-ngx/issues/1556#issuecomment-390896994
 
 
   So the following diff helps with the bad content-length and mismatching c-e 
headers:
   
   ```
   diff --git a/net/instaweb/rewriter/css_filter.cc 
b/net/instaweb/rewriter/css_filter.cc
   index 8f653cd..7724d5e 100644
   --- a/net/instaweb/rewriter/css_filter.cc
   +++ b/net/instaweb/rewriter/css_filter.cc
   @@ -253,6 +253,8 @@ bool CssFilter::Context::SendFallbackResponse(
        MessageHandler* handler) {
      // Do not set the content length, since we may need to mutate the
      // content as we stream out the bytes to correct for URL changes.
   +  
async_fetch->response_headers()->RemoveAll(HttpAttributes::kContentEncoding);
   +  
async_fetch->response_headers()->RemoveAll(HttpAttributes::kContentLength);
      async_fetch->HeadersComplete();
    
      DCHECK_EQ(1, num_slots());
   ```
   
   But I'm not sure that this is the right thing to do.
   
   Also, while testing this diff,  I observed that the combined css response 
alternates in size. It looks like the minified and non-minified version of the 
combination alternate randomly when  responses are served. This may be a 
related problem, or a totally different problem, I'm not sure. 
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to