Getting outdated data on fetch(), but current data on browser #492
Replies: 36 comments 90 replies
-
I am having the same problem...data fetched with my webcore piston (https GET) is outdated. Browser request yields current data. |
Beta Was this translation helpful? Give feedback.
-
It's important to open a support ticket for operational issues, that is the only way we can be assigned to work any fix. |
Beta Was this translation helpful? Give feedback.
-
Same issue here. Response header last modified is future dated. What gives? |
Beta Was this translation helpful? Give feedback.
-
The Feature_Flags workaround seems to work ... the first time. Then that gets cached and you have the same problem. So then if I change the Feature-Flag value each time, would that work? Hmmm ... seems to. I simply input a random number for the Feature-Flag: pp = requests.get(url,headers={'Feature-Flags': str(random.randint(1,1000))}) |
Beta Was this translation helpful? Give feedback.
-
Absolutely agree! I just can't figure out the syntax for the flags workaround.
Sent from Yahoo Mail on Android
On Fri, Dec 10, 2021 at 8:21 AM, ***@***.***> wrote:
not that I have any real clue what could be happening, but it seems like their cache server is caching when it shouldn't be. the feature-flags workaround seems to work for me, but without it, the API seemingly sometimes returns the correct data and sometimes returns old data, and has occasionally returned "internal server error".
basically, issue still relevant.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Beta Was this translation helpful? Give feedback.
-
I sent an e-mail to nco.ops (at noaa) per their website. I included a link to this discussion. Maybe they'll fix??? |
Beta Was this translation helpful? Give feedback.
-
I suspect web servers are out of sync.
…On Fri, Dec 10, 2021 at 8:58 AM lektrikpuke ***@***.***> wrote:
I sent an e-mail to nco.ops (at noaa) per their website. I included a link
to this discussion. Maybe they'll fix???
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#492 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH6QREF6R5UGKG5KB2TSECTUQIWVBANCNFSM5G44ZXVQ>
.
|
Beta Was this translation helpful? Give feedback.
-
The example I provided a week or so ago uses a value for feature flags. A
value that changes with each call. This causes the header to be different
each time. You will get a fresh page from the server. This bandaid is an
alternative to the good old tactic of using random stuff appended to the
URL. In this case the URL's are strict so you cannot append anything to the
url. Hope that helps.
…On Sat, Dec 11, 2021, 2:54 PM gunraidan ***@***.***> wrote:
Been having this problem: Did the feature flag thing to no success:
`#Scratch Pad
import requests
response = requests.get ("https://api.weather.gov/points/45.5117,-122.6756",
headers = {'Feature-Flags': ''});
data = response.json()
forecast = data["properties"]["forecast"]
response = requests.get(forecast)
data = response.json()
time = data["properties"]["periods"][1]["startTime"][:10]
time_cut = time[5:]
time_final_cut = time_cut[5:]
print(time_cut)`
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#492 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH6QREA5EZZS7SRKCWOH5VDUQPJB5ANCNFSM5G44ZXVQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Looking at the value for Feature flags in your code, it shows an empty
string. The value should contain characters. And the characters should
change each time. That is why I used a random number. I could very well be
missing something in your question. Hope that helps.
…On Sat, Dec 11, 2021, 7:28 PM gunraidan ***@***.***> wrote:
Isn't that what my code shows?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#492 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH6QREAZ2IINNZCSHA2ZQNDUQQJFRANCNFSM5G44ZXVQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Apparently when you change the coordinates to literally any other town it works fine. It's either the exact town messing up on the api's end or something with the cache. |
Beta Was this translation helpful? Give feedback.
-
I have been using whole numbers the entire time. In fact, I have been doing two requests one minute apart. I make a request with coordinates in Alaska (that will obviously be incorrect for me in Tennessee). Then a request for my area. I did this thinking that the data I was getting was being cached and was resulting in incorrect reports. Nope.
Spend some time with Jesus every day!
Todd Mumpower
On Saturday, December 11, 2021, 11:40:02 PM EST, gunraidan ***@***.***> wrote:
Possible solution:
When I round up the coordinates in the link in URL by replacing this:
response = requests.get ("https://api.weather.gov/points/45.5117,-122.6756")
with this:
response = requests.get ("https://api.weather.gov/points/46,-123")
It works fine. Really as long as either the longitude or latitude is a whole number.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Beta Was this translation helpful? Give feedback.
-
Give that new URL a while and you will eventually start getting old cached
copies again. The reason a browser never has a problem is that it sends
ever changing information in the request header. Therefore each request is
different, fetching a fresh copy every time. I think that is about all I
can think of. Hope that helped.
THE HORRIBLE THING ABOUT THIS is that we are adding little by little strain
on the web servers. It invalidates the reason for having a server farm.
This is nuts!!!!!!!!!!!!!!!!!!!!!!!!!!!
…On Sun, Dec 12, 2021 at 1:52 AM Pantheon ***@***.***> wrote:
I have been using whole numbers the entire time. In fact, I have been
doing two requests one minute apart. I make a request with coordinates in
Alaska (that will obviously be incorrect for me in Tennessee). Then a
request for my area. I did this thinking that the data I was getting was
being cached and was resulting in incorrect reports. Nope.
Spend some time with Jesus every day!
Todd Mumpower
On Saturday, December 11, 2021, 11:40:02 PM EST, gunraidan ***@***.***>
wrote:
Possible solution:
When I round up the coordinates in the link in URL by replacing this:
response = requests.get ("https://api.weather.gov/points/45.5117,-122.6756
")
with this:
response = requests.get ("https://api.weather.gov/points/46,-123")
It works fine. Really as long as either the longitude or latitude is a
whole number.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#492 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH6QREE27B6LHINWRJVUJMDUQRWHTANCNFSM5G44ZXVQ>
.
|
Beta Was this translation helpful? Give feedback.
-
I am getting invalid data in webcore often....usually several days behind.
Spend some time with Jesus every day!
Todd Mumpower
On Monday, December 13, 2021, 9:30:18 AM EST, wburliso ***@***.***> wrote:
Give that new URL a while and you will eventually start getting old cached
copies again. The reason a browser never has a problem is that it sends
ever changing information in the request header. Therefore each request is
different, fetching a fresh copy every time. I think that is about all I
can think of. Hope that helped.
THE HORRIBLE THING ABOUT THIS is that we are adding little by little strain
on the web servers. It invalidates the reason for having a server farm.
This is nuts!!!!!!!!!!!!!!!!!!!!!!!!!!!
On Sun, Dec 12, 2021 at 1:52 AM Pantheon ***@***.***> wrote:
I have been using whole numbers the entire time. In fact, I have been
doing two requests one minute apart. I make a request with coordinates in
Alaska (that will obviously be incorrect for me in Tennessee). Then a
request for my area. I did this thinking that the data I was getting was
being cached and was resulting in incorrect reports. Nope.
Spend some time with Jesus every day!
Todd Mumpower
On Saturday, December 11, 2021, 11:40:02 PM EST, gunraidan ***@***.***>
wrote:
Possible solution:
When I round up the coordinates in the link in URL by replacing this:
response = requests.get ("https://api.weather.gov/points/45.5117,-122.6756
")
with this:
response = requests.get ("https://api.weather.gov/points/46,-123")
It works fine. Really as long as either the longitude or latitude is a
whole number.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#492 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH6QREE27B6LHINWRJVUJMDUQRWHTANCNFSM5G44ZXVQ>
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Beta Was this translation helpful? Give feedback.
-
This is from another expert webcore programmer who did an evaluation of this API....I hate to say… but I suspect that even if we can force “fresh” data, the current API layout might frustrate more than illuminate.
For example, the numbers for each dataPoint do NOT line up. Currently, here is what I see:
112 slots in temperature (hourly for approx 4.6 days)
118 slots in dewpoint (4.9 days)
..8 slots in maxTemperature (approx a week)
..9 slots in minTemperature (approx a week)
.81 slots in relativeHumidity
..1 slots in heatIndex
133 slots in windChill
.34 slots in skyCover (every 3+ hours?)
.24 slots in windDirection (every 3 hours?)
Wow. This is a coding nightmare. You would have to pull (and convert) the validTime for every single data point needed…
IE: No more simple coding like:
IF temp[1] is greater than temp[2]
(because 1 or 2 could mean anything)
Sent from Yahoo Mail on Android
On Fri, Dec 10, 2021 at 8:21 AM, ***@***.***> wrote:
not that I have any real clue what could be happening, but it seems like their cache server is caching when it shouldn't be. the feature-flags workaround seems to work for me, but without it, the API seemingly sometimes returns the correct data and sometimes returns old data, and has occasionally returned "internal server error".
basically, issue still relevant.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Beta Was this translation helpful? Give feedback.
-
I posted this on another thread for this problem, but removing the headers in the curl request seems to give the appropriate data for the request. If I include the header array ("Accept: application/json",) it fails most times. Maybe one of their servers is having issues or out of sync with another? It is baffling. |
Beta Was this translation helpful? Give feedback.
-
Similar to Ken, getting some stale data. https://api.weather.gov/gridpoints/BOX/64,79/forecast/hourly Fetch from my 1&1 Ionos service returns this. If I use my browser (via RCN), I get fresh data.
|
Beta Was this translation helpful? Give feedback.
-
I'm still seeing Stale also:
|
Beta Was this translation helpful? Give feedback.
-
Latest status via email from NCO Ops:
|
Beta Was this translation helpful? Give feedback.
-
Okay, update. The data is recent for some zipcodes but not others. Glad to know you are on the case, but is there anything I can do to help? |
Beta Was this translation helpful? Give feedback.
-
Update I just received:
|
Beta Was this translation helpful? Give feedback.
-
Please forgive my questions that may sound critical but that I don't mean
to sound personal. I hope people will chime in to let me know if I am off
base or not:
Can we help effectively escalate an issue? It seems this issue has been
going on for some time.
Is there a priority level on this public service? I think it could be
helpful to know what we should expect.
Is there a particular link to more comprehensive documentation?
I wonder if a forum might be a better way for us to communicate as an
alternative to email lists. Is there a way to request enhancements like
this?
Please let me know if I am in the right place to ask these questions.
Thank you!
…On Fri, Feb 11, 2022, 6:13 AM JJKraw ***@***.***> wrote:
Update I just received:
At 1355z, current status for the issue of old/stale data during API call,
is:
- NWS/NCO/OBT - has identified what appears to be a common Akamai edge
server still serving a very old cache despite our efforts to clear it.
--- We have opened a support ticket with Akamai for assistance in clearing
the stubborn cache. AKAM-CASE #F-CS-5740418.
Status Update pending outcome of vendor assistance.
—
Reply to this email directly, view it on GitHub
<#492 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH6QREAI45JCUYZG3HQYOHDU2UKSHANCNFSM5G44ZXVQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
More thorough documentation of the API can be found here. This issue has been assigned to a release but that release continues to be pushed back for other higher priority tasks assigned to the development team. We have identified what we believe to be the last change we need to make to mask the issue until the backing service can be fully upgraded. Our understanding of the problem differed slightly from what is occurring. We are seeking approval for the change to be made next week. |
Beta Was this translation helpful? Give feedback.
-
We have just pushed what should be the final change required for this. Please let us know. |
Beta Was this translation helpful? Give feedback.
-
This query is still giving old results as of right now (15:25 EST): |
Beta Was this translation helpful? Give feedback.
-
I have been getting the right day for a week or so. But getting lots of 500's (about every other).
Spend some time with Jesus every day!
Todd Mumpower
On Friday, February 25, 2022, 3:28:08 PM EST, mbof ***@***.***> wrote:
Seems to work for me now!
$ curl -s https://api.weather.gov/gridpoints/LOX/148,44/forecast | grep generatedAt
"generatedAt": "2022-02-25T20:22:54+00:00",
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
The query I am using works correctly now, it's hitting a different virtual server now ( |
Beta Was this translation helpful? Give feedback.
-
Looking good here! Getting up-to-date forecast data. No Feature-Flag workaround needed! 🤞
|
Beta Was this translation helpful? Give feedback.
-
It appears that I am getting good data. No Feature_Flag workaround for me either. But I am a little confused by the nomenclature. I live in the Eastern time zone and I get the following:
So is my "Today" startTime adjusted for my Eastern time zone, ie -05:00?Is the detailedForecast for an actual time of 6 am (for me) as indicated by the "startTime" above?Or do I need to make the -05:00 adjustment myself?
Spend some time with Jesus every day!
Todd Mumpower
Spend some time with Jesus every day!
Todd Mumpower
On Saturday, February 26, 2022, 2:57:26 PM EST, John Kline ***@***.***> wrote:
Looking good here! Getting up-to-date forecast data. No Feature-Flag workaround needed!
Don’t be hasty. I had 18 hours of good forecasts before getting December forecasts again.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
All of the timestamps and any textual times in detailedForecast or other fields have been adjusted to local time. No need to convert anything unless you wanted to present it in the context of another time zone. Not sure why you'd do that though. |
Beta Was this translation helpful? Give feedback.
-
One thing to try if you are still getting responses with Last-Modified headers is to flush the DNS on the client side. |
Beta Was this translation helpful? Give feedback.
-
The issue I have is the following: when requesting the endpoint
https://api.weather.gov/gridpoints/TOP/31,80/forecast
directly from chrome, everything works fine and I get the current data with valid timestamps.However, when I hit the same URL using fetch() in JavaScript, I get outdated weather data, with an invalid last-modified header.
This is the response I get from chrome:
And this is the response
fetch('https://api.weather.gov/gridpoints/TOP/31,80/forecast')
gets me:As you can see, the last-modified header in the fetch() response is in the future.
The server also blocks me from using if-modified-since and cache-control headers, returning a CORS error because said headers are not allowed; but their official FAQ says you should send that particular header to get new data.
But somehow chrome is able to send the header when doing the request...
Request headers from chrome:
What's going on?
EDIT: Workaround (kind of)
Adding the header 'Feature-Flags' to the request seems to fix the issue, no matter the content of the header:
fetch('https://api.weather.gov/gridpoints/TOP/31,80/forecast', {headers: {'Feature-Flags': ''}});
I have no real explanation for this behavior, so the issue persists
Beta Was this translation helpful? Give feedback.
All reactions