Skip to content
Snippets Groups Projects
Commit 7640a8cb authored by Frédéric Guillot's avatar Frédéric Guillot
Browse files

Ignore caching headers for feeds that send "Expires: 0"

parent 3d59cdba
No related branches found
No related tags found
No related merge requests found
......@@ -129,17 +129,25 @@ func (c *Client) executeRequest(request *http.Request) (*Response, error) {
ContentLength: resp.ContentLength,
}
logger.Debug("[HttpClient:%s] OriginalURL=%s, StatusCode=%d, ContentLength=%d, ContentType=%s, ETag=%s, LastModified=%s, EffectiveURL=%s",
logger.Debug("[HttpClient:%s] URL=%s, EffectiveURL=%s, Code=%d, Length=%d, Type=%s, ETag=%s, LastMod=%s, Expires=%s",
request.Method,
c.url,
response.EffectiveURL,
response.StatusCode,
resp.ContentLength,
response.ContentType,
response.ETag,
response.LastModified,
response.EffectiveURL,
resp.Header.Get("Expires"),
)
// Ignore caching headers for feeds that do not want any cache.
if resp.Header.Get("Expires") == "0" {
logger.Debug("[HttpClient] Ignore caching headers for %q", response.EffectiveURL)
response.ETag = ""
response.LastModified = ""
}
return response, err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment