Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$slowfs_cache_status is almost always HIT #7

Open
runningman84 opened this issue Oct 28, 2013 · 0 comments
Open

$slowfs_cache_status is almost always HIT #7

runningman84 opened this issue Oct 28, 2013 · 0 comments

Comments

@runningman84
Copy link

My configuration looks like this:

    location / {
        slowfs_cache_valid 7d;
        add_header X-Cache-Status $slowfs_cache_status;
    }

The X-Cache-Status header is almost always HIT even if this is the first request for a given url. Is this a known bug?

This is my test case:

curl -I http://10.172.252.136:8081/r/t/jd/27489985056993_image146x114.jpg
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 28 Oct 2013 10:53:17 GMT
Content-Type: image/jpeg
Content-Length: 3406
Last-Modified: Wed, 14 Aug 2013 00:41:35 GMT
Connection: keep-alive
X-Cache-Status: HIT
Accept-Ranges: bytes

~/slowfs: grep -r 16419733655777_image166x130.jpg *
Übereinstimmungen in Binärdatei cache/e8/c0/bce8007ecc71ec6f0c2d8c439784c0e8
~/slowfs: head -3 cache/e8/c0/bce8007ecc71ec6f0c2d8c439784c0e8 | tail -1
KEY: 10.172.252.136/r/t/jd/27489985056993_image146x114.jpg
~/slowfs: ls -la cache/e8/c0/bce8007ecc71ec6f0c2d8c439784c0e8
-rw------- 1 nginx nginx 3507 28. Okt 11:48 cache/e8/c0/bce8007ecc71ec6f0c2d8c439784c0e8

# ok lets remove the cache file

~/slowfs: rm cache/e8/c0/bce8007ecc71ec6f0c2d8c439784c0e8

# double check

~/slowfs: grep -r 16419733655777_image166x130.jpg *
... nothing found

# now the cache should be really clean?!

curl -I http://10.172.252.136:8081/r/t/jd/27489985056993_image146x114.jpg
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 28 Oct 2013 10:54:29 GMT
Content-Type: image/jpeg
Content-Length: 3406
Last-Modified: Wed, 14 Aug 2013 00:41:35 GMT
Connection: keep-alive
X-Cache-Status: HIT
Accept-Ranges: bytes

# another hit but a new cache file... so this should be a MISS

~/slowfs: grep -r 16419733655777_image166x130.jpg *
Übereinstimmungen in Binärdatei cache/6a/c6/653ea58bcd99cfbb3795208f66e6c66a.
~/slowfs: ls -la cache/6a/c6/653ea58bcd99cfbb3795208f66e6c66a
-rw------- 1 nginx nginx 3168 28. Okt 11:54 cache/6a/c6/653ea58bcd99cfbb3795208f66e6c66a
~/slowfs: head -3 cache/6a/c6/653ea58bcd99cfbb3795208f66e6c66a | tail -2
KEY: 10.172.252.136/h/h/hh/16419733655777_image166x130.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant