Skip to content

feat: add etag and if-none-match support#13

Merged
lann merged 1 commit into
spinframework:mainfrom
FrankYang0529:add-etag
Jun 27, 2022
Merged

feat: add etag and if-none-match support#13
lann merged 1 commit into
spinframework:mainfrom
FrankYang0529:add-etag

Conversation

@FrankYang0529
Copy link
Copy Markdown
Contributor

related #3

> curl -i http://127.0.0.1:3000/content/hello-test.txt
HTTP/1.1 200 OK
cache-control: max-age=31536000
etag: 6926063833195007572
content-type: text/plain
content-length: 14
date: Sat, 25 Jun 2022 14:22:11 GMT

hello, world!

> curl --header "if-none-match: 6926063833195007572" -i http://127.0.0.1:3000/content/hello-test.txt
http://127.0.0.1:3000/content/hello-test.txt
HTTP/1.1 304 Not Modified
cache-control: max-age=31536000
etag: 6926063833195007572
content-type: text/plain
date: Sat, 25 Jun 2022 14:22:33 GMT

# change content in content/hello-test.txt and restart spin-fileserver

> curl --header "if-none-match: 6926063833195007572" -i http://127.0.0.1:3000/content/hello-test.txt
HTTP/1.1 200 OK
cache-control: max-age=31536000
etag: 11480734396890654158
content-type: text/plain
content-length: 4
date: Sat, 25 Jun 2022 14:23:39 GMT

123

> curl --header "if-none-match: 11480734396890654158" -i http://127.0.0.1:3000/content/hello-test.txt
http://127.0.0.1:3000/content/hello-test.txt
HTTP/1.1 304 Not Modified
cache-control: max-age=31536000
etag: 11480734396890654158
content-type: text/plain
date: Sat, 25 Jun 2022 14:23:51 GMT

Signed-off-by: Frank Yang <yangpoan@gmail.com>
@lann
Copy link
Copy Markdown
Contributor

lann commented Jun 27, 2022

Thanks!

@lann lann merged commit ca0bf1a into spinframework:main Jun 27, 2022
@FrankYang0529 FrankYang0529 deleted the add-etag branch June 27, 2022 14:49
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 this pull request may close these issues.

2 participants