Closed ties closed 3 years ago
@ties thanks! Conditional requests are very useful indeed!
You indicate that your backend does not support eTags
, which probably means the change is harder to test. Perhaps it makes sense to split this into two aspects?
if-modified-since:
(which is a simpler mechanism, and you can test)@job I agree that is is good to be careful about this.
The current status is:
stayrtr
uses ETag
s, andrtrmon
does not use ETag
s nor if-modified-since:
.Because it is already used in stayrtr
, I think enabling ETag
s on rtrmon
is safe. The HTTP(S) endpoints that connects to are the same as stayrtr
already connects to.
I can test rtrmon
against endpoints that support only if-modified-since:
. How about this: If the code looks good, both headers are enabled in rtrmon
by default (since I think two toggles is not needed). if-modified-since:
gets disabled in stayrtr
by default for now (since I won't be actively running that), and may be set to default-enabled later.
Hi @ties
You wrote:
if-modified-since: gets disabled in stayrtr by default
Did you mean to say "If-none-match gets disabled in stayrtr by default" ?
Hi @job
Did you mean to say "If-none-match gets disabled in stayrtr by default" ?
I think it is already enabled by default. The new part (if-modified-since
) would be disabled by default (and the flag is intentionally named last.modified
after the server-side header for consistency).
Nice clean commits. Thanks for the contrib!
I think it was safe to merge. Thanks for handling this quickly :).
Adds
Last-Modified
header support and enables this (andETag
s) by default for rtrmon.I'm using rtrmon with a backend that suports
If-Modified-Since
but notIf-None-Match
. To poll this often (sub-minute interval) it is better to use conditional requests.I am not sure if it makes sense to enable this by default for
stayrtr
. My understanding is that the combination of both headers should be handled properly by back-ends (and are sent by browsers) - so it should be safe to do.Furthermore I am not a golang expert, so this change is a bit mechanical, let me know what you think.