@o-gtkv
Posted
Hi, Riley
"Not sure what in my JavaScript is causing the Firefox issue (maybe something missing from my code?)."
It's all about caching. After first fetch call, all following requests get data from cache, not from server. And so it will be until the cache will be expired. When exactly this happens depends on server's response, namely on HTTP header Cache-Control, and directive max-age. Its value can be seen on the Network tab in DevTools. So, in the server response it is listed twice as
- cache-control: max-age=2
- cache-control: max-age=600
2 seconds and 10 minutes. A server-side bug, apparently. Chrome takes the first value and ignores the second. Firefox vice versa (you can see the exact cache expiration time in about:cache). That is, everything works in Firefox too, but only once every ten minutes :) This can be fixed by passing, for example, { cache: "no-store" } object as second parameter to fetch. (more details here and here)
Hope this helps )
Marked as helpful
@rileydevdzn
Posted
Hi Oleg!
I looked up the cache: "no-store" parameter as you suggested, added it to fetch and it works perfectly in Firefox now. This is exactly what I needed, very helpful and well explained :)
Thank you so much for the help!