-
Notifications
You must be signed in to change notification settings - Fork 138
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
Better caching #794
Better caching #794
Conversation
OK, my git history is broken, I need to fix that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙋️
@@ -63,7 +63,7 @@ impl<'r> Responder<'r> for Ructe { | |||
let etag = format!("{:x}", hasher.finish()); | |||
if r.headers() | |||
.get("If-None-Match") | |||
.any(|s| s[1..s.len() - 1] == etag) | |||
.any(|s| s[1..s.len() - 1] == etag || s[3..s.len() - 1] == etag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can one of you two explain what this does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably get it's comment actually.
We send Etags as 'some_tag'
, the old match does not verify the '
, but check that whatever in-between is the right tag. Nginx apparently change the Etag to W/'some_tag'
, W/ indicating it's a weak Etag, the content may not be byte-equal, but is semantically identical (which is imo a shitty but correct interpretation of the RFC, as Nginx send compressed data)
The new match ignore that W/ saying it's a weak etag and so match if Nginx modified the header we sent previously
Comment might looks like : // if a strong or weak etag matches
don't we still have to to change the subscribe/follow/blah button from a form… to… well… a button? |
well there is that too, but these buttons are not here on the front page or a blog or user page. Anyway for post a better caching solution that does not require to query the database should be added |
Based on @trinity-1686a's patch: #786 (comment)
Codecov Report
@@ Coverage Diff @@
## main #794 +/- ##
==========================================
+ Coverage 38.98% 39.07% +0.08%
==========================================
Files 73 73
Lines 9777 9756 -21
Branches 2240 2233 -7
==========================================
Hits 3812 3812
+ Misses 4906 4886 -20
+ Partials 1059 1058 -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally sure, being new to the software and Rust, but this seems fair enough and a small change. Probably can be approved, right ?
@FreyjaWildes You're right. I merged this pull request as https://git.joinplu.me/Plume/Plume/pulls/840 Thank you for keeping interest on Plume! |
Based on @trinity-1686a's patch.
I'm not sure it is a fix for #786 but it is better than nothing.