I want to include my latest flickr photos and twitter status updates in a wordpress sidebar or footer using JSONP requests. The problem is of course each page reload will perform a new ajax call, and I believe the Twitter api has usage limits.
I was considering what cross-browser data persistance options I had with javascript and the best I could think of was cookies.
Would storing the ajax results in a cookie (Setting the expiry to day, I dont update my twitter/Flickr that often). be the best solution for a javascript-based Twitter and Flickr api call?
Thanks
The best solution for javascript-based Twitter and Flickr api calls when using WordPress is to use the WordPress Transient API. The Transient API is a persistent cache method built in to WordPress meant to cache items that change frequently. You can set the cache expires time and WordPress will check the database first for the transient if it returns false it will use the json call to return the item.
Here is an example using a transient and shortcodes to store a users most recent tweet. The code below is from Aaron Jorbin Twitter Transients Plugin