Best practices
Use GZIP compression
Compression reduces the amount of data being transferred and improves data request speed. Add HTTP headers to enable GZIP compression.
Curl
Code
- Without compression: 17,695 bytes
- With compression: 2,958 bytes
- Size reduction of 83%
TypeScript
Code
Randomize refresh rates
Randomize individual device refresh rates so that devices refresh at different clock times. Requesting updates on all devices at consistent times will overload the system.
Use the expires header
Refresh information from the AccuWeather APIs for your device based upon the cache expires time in the response headers. In the example below, refresh on Thursday, August 30th, 2012 at 14:56:34 GMT.
Code
Timezone offset changes for daylight saving time
If you intend to use the GMTOffset from the Location API response to calculate times local to the location, you MUST be careful to observe the NextOffsetChange property. The offset will change on the date and time specified. Using the expires header as described above will ensure that you have the most current GMTOffset for the location.