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

Revalidation with If-Modified-Since not working (always returning 200) #588

Open
mac-chaffee opened this issue Dec 21, 2024 · 1 comment · May be fixed by #589
Open

Revalidation with If-Modified-Since not working (always returning 200) #588

mac-chaffee opened this issue Dec 21, 2024 · 1 comment · May be fixed by #589

Comments

@mac-chaffee
Copy link

mac-chaffee commented Dec 21, 2024

Hello! We managed to get Souin integrated into pgs.sh and it's working great so far! https://blog.pico.sh/ann-026-pages-http-caching

I wanted to try out conditional requests (ref: picosh/pico#177) and I noticed that Souin seems to work fine with If-None-Match: "<etag>" conditional requests, but doesn't seem to work with If-Modified-Since: <date> conditional requests.

Example:

# Store the file in the cache

$ curl -iH "Host: picouser-test.pgs.dev.pico.sh" localhost:3000/file.txt                                                       
HTTP/1.1 200 OK
Cache-Control: max-age=600
Cache-Status: Souin; fwd=uri-miss; stored; key=GET-http-picouser-test.pgs.dev.pico.sh-/file.txt
Content-Length: 14
Content-Type: text/plain
Etag: "a9a83095955b3d3efacc7f833a103cb2-1"
Last-Modified: Sat, 21 Dec 2024 03:03:10 GMT
Surrogate-Key: picouser-test
Date: Sat, 21 Dec 2024 15:24:23 GMT

Hello, World!

# Send conditional request
$ curl -iH "Host: picouser-test.pgs.dev.pico.sh" -H "If-Modified-Since: Sat, 21 Dec 2024 09:09:10 GMT"  localhost:3000/file.txt
HTTP/1.1 200 OK
Age: 56
Cache-Control: max-age=600
Cache-Status: Souin; hit; ttl=544; key=GET-http-picouser-test.pgs.dev.pico.sh-/file.txt; detail=OTTER
Content-Length: 14
Content-Type: text/plain
Date: Sat, 21 Dec 2024 15:24:23 GMT
Etag: "a9a83095955b3d3efacc7f833a103cb2-1"
Last-Modified: Sat, 21 Dec 2024 03:03:10 GMT
Surrogate-Key: picouser-test

Hello, World!

It should have returned a 304 Not Modified response. Any ideas?

@darkweak
Copy link
Owner

Hey @mac-chaffee I'll integrate a possible patch for that in the PR #589.

darkweak added a commit that referenced this issue Dec 26, 2024
@darkweak darkweak linked a pull request Dec 26, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants