You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I recently implemented HEAD requests to check if a cached resource is expired, but discovered that such requests can take 10+ seconds.
What is the recommended approach to caching? Should I plan to keep track of the max-age on within my application? I suppose if the max-age never (or infrequently) changes for an endpoint, then I can just hardcode the value.
So I guess this is a feature request... to make HEAD requests respond quickly.
Here is a look at the logs with some timings for a few endpoints.
[03-Feb-2021 13:05:40 UTC] Loading Weather......................................
[03-Feb-2021 08:05:40 America/New_York] Retrieving https://api.weather.gov/points/42.3755,-71.0368.
[03-Feb-2021 08:05:40 America/New_York] Exist in cache.
[03-Feb-2021 08:05:41 America/New_York] HEAD took 0.127653s.
[03-Feb-2021 08:05:41 America/New_York] Cached resource is valid.
[03-Feb-2021 08:05:41 America/New_York] Retrieving https://api.weather.gov/gridpoints/BOX/71,77/forecast.
[03-Feb-2021 08:05:41 America/New_York] Exist in cache.
[03-Feb-2021 08:05:51 America/New_York] HEAD took 9.949158s.
[03-Feb-2021 08:05:51 America/New_York] Requesting from server.
[03-Feb-2021 08:06:04 America/New_York] Resource retrieved in 13.922203s.
[03-Feb-2021 08:06:04 America/New_York] Retrieving https://api.weather.gov/gridpoints/BOX/71,77/forecast/hourly.
[03-Feb-2021 08:06:04 America/New_York] Exist in cache.
[03-Feb-2021 08:06:19 America/New_York] HEAD took 14.124384s.
[03-Feb-2021 08:06:19 America/New_York] Requesting from server.
[03-Feb-2021 08:06:28 America/New_York] Resource retrieved in 9.670928s.
[03-Feb-2021 08:06:28 America/New_York] Retrieving https://api.weather.gov/gridpoints/BOX/71,77/stations.
[03-Feb-2021 08:06:28 America/New_York] Exist in cache.
[03-Feb-2021 08:06:28 America/New_York] HEAD took 0.083157s.
[03-Feb-2021 08:06:28 America/New_York] Cached resource is valid.
[03-Feb-2021 08:06:28 America/New_York] Retrieving https://api.weather.gov/stations/KBOS/observations/latest.
[03-Feb-2021 08:06:28 America/New_York] Exist in cache.
[03-Feb-2021 08:06:28 America/New_York] HEAD took 0.09773s.
[03-Feb-2021 08:06:28 America/New_York] Requesting from server.
[03-Feb-2021 08:06:29 America/New_York] Resource retrieved in 0.092261s.
This discussion was converted from issue #162 on April 10, 2021 00:39.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I recently implemented HEAD requests to check if a cached resource is expired, but discovered that such requests can take 10+ seconds.
What is the recommended approach to caching? Should I plan to keep track of the max-age on within my application? I suppose if the max-age never (or infrequently) changes for an endpoint, then I can just hardcode the value.
So I guess this is a feature request... to make HEAD requests respond quickly.
Here is a look at the logs with some timings for a few endpoints.
Beta Was this translation helpful? Give feedback.
All reactions