Title: Caching Data
Last modified: December 13, 2016

---

# Caching Data

 *  Resolved [lee317](https://wordpress.org/support/users/lee317/)
 * (@lee317)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/caching-data/)
 * 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)

 *  [Pierre Lannoy](https://wordpress.org/support/users/pierrelannoy/)
 * (@pierrelannoy)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/caching-data/#post-8546541)
 * 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](https://wordpress.org/support/users/lee317/)
 * (@lee317)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/caching-data/#post-8547957)
 * 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)?
 *  [Pierre Lannoy](https://wordpress.org/support/users/pierrelannoy/)
 * (@pierrelannoy)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/caching-data/#post-8548107)
 * 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](https://wordpress.org/support/users/lee317/)
 * (@lee317)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/caching-data/#post-8548595)
 * 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.
 *  [Pierre Lannoy](https://wordpress.org/support/users/pierrelannoy/)
 * (@pierrelannoy)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/caching-data/#post-8548698)
 * Your value is right: it’s approx. 140/day per station.
 * You can track your consumption here : [https://www.wunderground.com/weather/api/](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](https://wordpress.org/support/users/lee317/)
 * (@lee317)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/caching-data/#post-8548704)
 * 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.
 *  [Pierre Lannoy](https://wordpress.org/support/users/pierrelannoy/)
 * (@pierrelannoy)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/caching-data/#post-8548716)
 * You’re welcome!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Caching Data’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/live-weather-station_4275b8.svg)
 * [Weather Station](https://wordpress.org/plugins/live-weather-station/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/live-weather-station/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/live-weather-station/)
 * [Active Topics](https://wordpress.org/support/plugin/live-weather-station/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/live-weather-station/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/live-weather-station/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Pierre Lannoy](https://wordpress.org/support/users/pierrelannoy/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/caching-data/#post-8548716)
 * Status: resolved