question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Revalidated policy contains new response headers even if not modified

See original GitHub issue
ORIGINAL POLICY {
  'content-type': 'application/json',
  'last-modified': 'Wed, 27 Nov 2019 01:56:57 GMT',
  'content-encoding': 'gzip',
  age: '449457',
  date: 'Sun, 08 Dec 2019 14:21:24 GMT',
  warning: '113 - "rfc7234 5.5.4"'
}
REVALIDATED POLICY modified=false {
  age: '449457',
  date: 'Sun, 08 Dec 2019 14:21:24 GMT'
}

I just placed

console.log('ORIGINAL POLICY', CachePolicy.fromObject(revalidate.cachePolicy).responseHeaders());
console.log('REVALIDATED POLICY', `modified=${revalidatedPolicy.modified}`,  revalidatedPolicy.policy.responseHeaders());

after this line:

https://github.com/lukechilds/cacheable-request/blob/147924989daf078b071be3aa4ad67cc6702512f0/src/index.js#L87

I will include some reproducible code soon.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
szmarczakcommented, Dec 23, 2019

I have done more digging. The second response doesn’t include any validation header so this is correct behavior.

1reaction
kornelskicommented, Dec 9, 2019

However, content-type is missing, and that probably needs fixing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cache-Control - HTTP - MDN Web Docs
The proxy-revalidate response directive is the equivalent of must-revalidate , but specifically for shared caches only. no-store. The no-store ...
Read more >
Chrome doesn't send "If-Modified-Since" - Stack Overflow
"The rule is actually quite simple: any error with the certificate means the page will not be cached." https://code.google.com/p/chromium/issues ...
Read more >
Custom Cache-Control response header for `/_next/image`
I'm getting this Response header: Cache-Control: public, ... <img> tag it's actually changed, whereas for new <Image> component it is not.
Read more >
Introducing Smart Edge Revalidation - The Cloudflare Blog
Revalidation checks occur when a browser sends a request to a cache server using If-Modified-Since or If-None-Match headers. These request ...
Read more >
Staleness and revalidation - Fastly Developer Hub
The HTTP Cache-Control header directives stale-while-revalidate and stale-if-error (which trigger scenarios 1 and 2 above) are HTTP standards defined in RFC ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found