Cache system
Generally, there are two options to access data of the weather APIs. Without setting up a cache system, users access the meteoblue server directly when requesting data of the weather API (see variation 1). The customer server can easily set up a storage (cache system). This makes it possible that users do not access the meteoblue server directly, while still having access to the most recent weather data (see variation 2).
Variation 1 without cache system
In case no cache system is installed at the client, it has to be considered that:
- Higher costs are generated with request-based pricing models (meteoblue server is accessed more often)
- Information transfer can require more time
Variation 2 with cache system
Setting up a cache system can be advantageous:
- Reduction of operating costs of weather data supply as meteoblue server is accessed less often
- Fast data transfer
- Simple implementation
- Transparency – constantly updated weather data is ensured
PHP example to implement a cache layer when using our API
We recommend using a cache layer to reduce the total amount of queries to our servers (which will result in lower costs for you) and improve latency. A popular and easy way to use cache is memcached:
|
|