Code Monkey home page Code Monkey logo

Comments (1)

jaypatrickhoward avatar jaypatrickhoward commented on July 1, 2024

I figured out what's going on with Apache.

Our server is configured to return compressed content (mod_deflate) when the request comes in over HTTPS but not otherwise. Apache chooses a transfer mode based on whether the content's length exceeds its "DeflateBufferSize" setting.

If the content is greater than DeflateBufferSize then the server uses chunked mode, which means no "Content-Length" is included with the response. HttpResponseCache handles this case correctly.

However, if the content is less than DeflateBufferSize then it sends a value for "Content-Length" that is the length of the compressed data. This is the case that HttpResponseCache doesn't handle correctly.

The problem disappears when I load the images over HTTP because our server is configured to only use compression for HTTPS. It has nothing to do with SSL whatsoever.

What I suspect is happening is that the somewhere in the cache code a comparison is made between "reported content-length" and "bytes read" in order to detect incomplete responses, but the "bytes read" value used is the byte count of the decoded content instead of the byte count of the raw content, which is what "Content-Length" is supposed to describe.

from httpresponsecache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.