About Buffering
Why use buffering
Buffering will greatly increase the speed of your website and reduce the load on yr's servers.
When to use file buffering
When only one page on your website displays weather data. If several pages display weather data, file buffering can fail.
Example using file buffering.
When to use SQL buffering
When several pages on your website display weather data or if you use the same buffer across several sites.
Example using SQL buffering.
How it works
When file buffering or SQL buffering is turned on, easyYr will store all the data fetched from yr.no either in files or in a SQL table. When your script requests weather data, easyYr will return the buffered data if this is available. If there is no buffered data available, it will be fetched from yr.no and then buffered. Since the weather data from yr.no comes with an expiration timestamp, easyYr will automatically fetch new data whenever the buffered data expires.
It it complicated to use?
No! Turning on file buffering is 1 line of extra code. Turning on SQL buffering requires you to connect to the database, then add 1 line of extra code. There's no difference in how you use easyYr after buffering is turned on. Everything is done for you behind the scenes.