Pirate-Weather / pirateweather

Code and documentation for the Pirate Weather API
Apache License 2.0
663 stars 30 forks source link

Local cache issue #350

Open cloneofghosts opened 1 week ago

cloneofghosts commented 1 week ago

Describe the issue

I've noticed a few times in Breezy Weather where the automatic refresh would show data from the previous refresh. I noticed today that when I query the API in my browser that unless I refresh the page after the call I would get cached data from the first time I queried the API no matter how long it's been since the query.

I think this is because the Cache-Control header is missing the must-revalidate response directive .

Acknowledgements

cloneofghosts commented 5 days ago

@alexander0042 Still encountering this issue five days later. I queried the API this morning at 9:39am in my browser and every time I open a new tab and query the API again I still see the data from 9:39am. I have to refresh after I initially load the page in order to get updated data.

alexander0042 commented 5 days ago

Thanks for flagging this, especially since you found the exact fix! I'll add that directive in and we can see if it fixes it

cloneofghosts commented 3 days ago

Just pinging here to see if there's any update here @alexander0042. I saw you comment two days ago but haven't seen any changes to the Cache-Control header on live or dev.