What headers send the source server (web server) back with your content? In order to be cached using squid, I believe that you usually need to specify either Last-Modified or ETag in the response header. Web servers usually do this automatically for static content, but if your content is dynamically served (even if from a static source), then you need to make sure that they are there and handle request headers such as If-Modified-Since and If-None -Match.
Also, since I pointed out this question to your next session question --- is there a βVaryβ heading in the answer? For example, βVary: Cookieβ tells caches that the content may vary depending on the cookie header in the request: therefore, static content wants to delete it. But your web server can add this to all requests if there is a session, regardless of the static / dynamic nature of the data being served.
In my experience, some experiments with HTTP headers to see which effects are cached are of great benefit: I remember that the solution was not always obvious.
source share