libostree: Add support for ETag and Last-Modified headers
Add support in the soup and curl fetchers to send the `If-None-Match` and `If-Modified-Since` request headers, and pass on the `ETag` and `Last-Modified` response headers. This currently introduces no functional changes, but once call sites provide the appropriate integration, this will allow HTTP caching to happen with requests (typically with metadata requests, where the data is not immutable due to being content-addressed). That should reduce bandwidth requirements. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
1 parent
9f98aa9223
commit
407c683524
7 files changed
+410
-19
No files matched your search
@@ -436,8 +436,10 @@ try_one_url (OstreeMetalinkRequest *self,
|
||||
|
||||
if (!_ostree_fetcher_request_uri_to_membuf (self->metalink->fetcher,
|
||||
uri, 0,
|
||||
NULL, 0,
|
||||
self->metalink->n_network_retries,
|
||||
&bytes,
|
||||
NULL, NULL, NULL,
|
||||
self->metalink->max_size,
|
||||
self->cancellable,
|
||||
error))
|
||||
@@ -618,8 +620,9 @@ _ostree_metalink_request_sync (OstreeMetalink *self,
|
||||
request.parser = g_markup_parse_context_new (&metalink_parser, G_MARKUP_PREFIX_ERROR_POSITION, &request, NULL);
|
||||
|
||||
if (!_ostree_fetcher_request_uri_to_membuf (self->fetcher, self->uri, 0,
|
||||
NULL, 0,
|
||||
self->n_network_retries,
|
||||
&contents, self->max_size,
|
||||
&contents, NULL, NULL, NULL, self->max_size,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
|
||||
|
||||
Reference in new issue
Block a user