Re: Apache 2.4 : issue caching mod_cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eric,
I checked the configuration to verify if cookie or set-cookie headers are excluded and this is the actual configuration:

<IfModule mod_cache.c>
  CacheIgnoreCacheControl On
  CacheIgnoreQueryString Off
  CacheIgnoreURLSessionIdentifiers _
  CacheIgnoreHeaders Set-Cookie Cookie
  CacheDefaultExpire 60
  CacheMaxExpire 300
  <IfModule mod_cache_disk.c>
    CacheRoot /var/cache/apache/
    CacheMaxFileSize 5000000000
    CacheEnable disk /files/
  </IfModule>
</IfModule>

I also tried to add the unset of Vary header:

<Location /files/json/test.json>
  Header unset Vary
</Location>

The responde headers were:

HTTP/1.1 200 OK
Date: Thu, 07 Jul 2022 12:30:34 GMT
Server: Apache
Strict-Transport-Security: max-age=16070400; includeSubDomains; preload
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Last-Modified: Thu, 07 Jul 2016 13:35:02 GMT
Accept-Ranges: bytes
Content-Length: 13085
X-Powered-By: ASP.NET
X-UA-Compatible: IE=edge,chrome=1
Content-Security-Policy: frame-ancestors 'self'
Cache-Control: max-age=300
Content-Security-Policy-Report-Only: xxx
Content-Type: application/json

but the logs reported:

127.0.0.1 [07/Jul/2022:14:30:34 +0200] 251 "GET /files/json/testt.json?test=1 HTTP/1.1" 200 13085 cache miss: attempting entity save

I also added the headers debug for mod_cache module:

HTTP/1.1 200 OK
Date: Thu, 07 Jul 2022 12:33:14 GMT
Server: Apache
Strict-Transport-Security: max-age=16070400; includeSubDomains; preload
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Last-Modified: Thu, 07 Jul 2016 13:35:02 GMT
Accept-Ranges: bytes
Content-Length: 13085
X-Powered-By: ASP.NET
X-UA-Compatible: IE=edge,chrome=1
Content-Security-Policy: frame-ancestors 'self'
Cache-Control: max-age=300
Content-Security-Policy-Report-Only: xxx
X-Cache: MISS from localhost
X-Cache-Detail: "cache miss: attempting entity save" from localhost
Content-Type: application/json

Regards,
Marcello

On Thu, Jul 7, 2022 at 1:58 PM Eric Covener <covener@xxxxxxxxx> wrote:
On Thu, Jul 7, 2022 at 7:41 AM Marcello Lorenzi <cello86@xxxxxxxxx> wrote:
>
> Hi Eric,
> thanks for the response. The responses headers are:
>
> HTTP/1.1 200 OK
> Date: Thu, 07 Jul 2022 11:39:41 GMT
> Server: Apache
> Strict-Transport-Security: max-age=16070400; includeSubDomains; preload
> X-Xss-Protection: 1; mode=block
> X-Content-Type-Options: nosniff
> Vary: Cookie,Accept-Encoding

Vary: Cookie is the likely culprit. This means each unique Cookie:
request header gets a different result.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux