~alcinnz/hurl

b9a5ac6590efc13856015f854f4fa38a5b05eada — Adrian Cochrane 3 years ago 5a4a453
ISSUE: add Upgrade-Insecure-Request header, close openwith & caching issues.
3 files changed, 3 insertions(+), 30 deletions(-)

D ISSUES/cache-responses.md
D ISSUES/openwith-menu.md
A ISSUES/request-https.md
D ISSUES/cache-responses.md => ISSUES/cache-responses.md +0 -24
@@ 1,24 0,0 @@
# Cache Responses
HTTP responses should be cached locally according to their cache-control headers.
Especially once Rhapsode starts supporting hyperlinks.

This could be developed as an independant project and integrated in!

## Caching headers
* `CacheControl`, legacy `Pragma: no-cache`
* `Expires`, may also be set via `CacheControl` or `Last-Modified`
* `Etag` - echo back in `If-None-Match`
* `Last-Modified` - echo back in `If-Modified-Since`
* `Vary` - indicates which headers to compare for equality before using a cache.

Use cached data for 304 responses.

## Implementation
I'd store an index file, with cached bodies stored seperately.

There'd be four parts to implementing the cache:
1. Annotating the request.
2. Loading cached data for 304 responses.
3. Storing cache responses.

GNOME's implementation: https://github.com/GNOME/libsoup/blob/mainline/libsoup/soup-cache.c

D ISSUES/openwith-menu.md => ISSUES/openwith-menu.md +0 -6
@@ 1,6 0,0 @@
# Open With Menu
Since HURL is querying the OS for which apps to open a link with (by MIMEtype or URI scheme),
it should expose these options to the caller.

In Rhapsode these would become psuedo-links for the user to open text or XML-based files in
a specified app, which would be especially nice for handling webfeeds!

A ISSUES/request-https.md => ISSUES/request-https.md +3 -0
@@ 0,0 1,3 @@
Rhapsode should send the Upgrade-Insecure-Requests header to indicate websites should redirect to HTTPS. Most do regardless, but might as well.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade-Insecure-Requests