Conditional GETs
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by tracing plumber2's GET/HEAD route handling and the existing ETag tag creation functionality mentioned in issue #75. Review the conditional-request reference, then define how the proposed @etag value would be generated and compared. Done means matching GET/HEAD requests return 304 without a response body, while initial 200 responses include the generated ETag.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
It would be neat if plumber2 supported conditional GETs out of the box. I suspect I could use the tag creation functionality to do it myself, but it would be a nice to have for improving server-side rendered HTML applications.
Using an etag, plumber2 could automatic respond with a 304 Not Modified and short-circuit the response if the client's If-None-Match matches the server. This would speed up server responses and reduce repetitive computations. Perhaps the etag generation mechanism could be specified by a roxygen tag too.
Eg
#' @get /
#' @etag Sys.Date()
function() {
my_html()
}
In this example, on a 200 OK, the server would return the normal response body as well as etag generated via Sys.Date(). Subsequent gets from the same client would return a 304 to the client if the client's etag date matches the server's (via string equality).
Scope: only applies to GET/HEAD routes, & no response body is sent
References
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Conditional_requests
- https://api.rubyonrails.org/classes/ActionController/ConditionalGet.html
As an aside (and probably out of scope for this issue), being able to have a @cache tag to automatically cache responses would be nice. We can do this manually atm via eg memoise and client id, but it would make these patterns more discoverable and feel more "batteries included" particularly for SSR purposes
- Lingua principale
- R
- Stelle
- 119
- Fork
- 17
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di posit-dev/plumber2
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
`except` argument in `Plumber2$add_shiny` method is not respectedForse già presa @cgiachalis l’ha presa 139 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
-
Development RoadmapAperta
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 20/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
Tutte le issue di posit-dev/plumber2
Issue simili
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothApertaarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Apich-Organization/rssn#383 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PRL-PRG/r-compile-server#70 · 1 commento ·
-
dependencies docker enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
posit-dev/images-workbench#257 ·
I maintainer di solito rispondono entro 1 giorno
-
dependencies docker enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
posit-dev/images-package-manager#188 ·
I maintainer di solito rispondono entro 1 giorno
-
dependencies docker enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
posit-dev/images-connect#222 ·
I maintainer di solito rispondono entro 1 giorno