• Resolved lee317

    (@lee317)


    Is there a way to have the plugin store data retrieved from the API so that each new page-load doesn’t generate an API request? It would be nice to not query the server multiple times per minute when the weather data has likely not changed and it would also save on expenses when looking for a weather source.

Viewing 7 replies - 1 through 7 (of 7 total)
  • H E L L O !

    I am a bit surprised by your question / remark… Data source are cached in database, so API requests are not made for each page reload. What do you mean by “cached”?

    Pierre

    Thread Starter lee317

    (@lee317)

    I couldn’t tell if that was happening or not since the time stamp below the data seemed to be updated to the minute. Is there a way to control how often the plugin queries the api for data (ie when the cached data expires)?

    There’s no control you can have on it. And I don’t understand why you would control it… Cache is implemented everywhere in Weather Station and this seems to me relatively well balanced (between freshness of data, capacity of services and stations and API quotas).

    To me more specific:

    – for Netatmo, Weather Underground and located stations (via OpenWeatherMap), the polling is done every 10 minutes (cached in database);
    – for clientraw.txt and realtime.txt stations, the polling is done every 5 minutes (cached in database);
    – for current observations (via OpenWeatherMap) added to all stations, the polling is done every 15 minutes (cached in database);
    – for pollution data (via OpenWeatherMap) added to all stations, the polling is done every 30 minutes (cached in database);

    – for computations (indexes and astronomical) it is done when new data is store (on a station by station basis) and cached in database;

    – for stations pulling (to share data with PWS, MET Office and Wunderground), when it is activated, it is done every 10 minutes (which is the recommended value) – of course pulling have no cache;

    – for backend and frontend sql queries, the cache is set on 30 minutes with invalidation policy (transient caching);

    – for backend rendering, the “duplicate queries” cache is set based on the complete cycle for generating a page (cached in memory).

    Obviously, only polling cache have effect on reducing API calls (see the first 4 lines).

    I’m sorry if this answer is not what you are waiting for, I doesn’t understand what is really your question.

    Thread Starter lee317

    (@lee317)

    I asked because I wanted to better understand how frequently the plugin would be querying the API since I am paying Weather Underground per API query. Presently I have a maximum of 500 API queries to WU per day but based on what your saying, I expect that there should be no more than 144 queries per 24 hour period to the WU API: 24 hours per day X 60 min per hour = 1440 minutes per day ÷ 10 minute increments = 144.

    Your value is right: it’s approx. 140/day per station.

    You can track your consumption here : https://www.wunderground.com/weather/api/

    But I’m very surprised, the 500 API calls per day (stratus, cumulus, anvil for developers) is free… (?)

    Never mind, if I answered your question, it’s a good thing ??

    Thread Starter lee317

    (@lee317)

    Yes, 500 per day is free. After that you have to pay for a plan that supports more API calls. Thanks for the quick responses and for the great plugin.

    You’re welcome!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Caching Data’ is closed to new replies.