So, I’m currently making Weather App project and I encountered a problem. Openweathermap suggests that you should make an API call not more than every 2 hours, because weather doesn’t usually change so quickly. So I came up with an idea:
- When you load a page, something checks when was your last API call and if it was earlier than 2 hours ago, it would automatically send a request again
- There would be a “refresh” button that would make a request when you press it.
The problem is - how should I do it? I thought about using cookies but I don’t really know much about them, whether they have some kind of timestamp etc. Thanks for help.