If you use caching in Apps Script (and you should), you might hit the 100k limit on cache sizes. I've written about how to get round that by writing several cache entries and linking them to a single key, but another (better) approach, is to zip (compress) the data before writing it out. It's a bit tricky to get all the blobs and b64's and zips sorted out but here's how to do it.
Let's say you have a large array of objects you want to write to cache. You can write it like this
cache.put (cacheKey , Utilities.base64Encode(Utilities.zip ([Utilities.newBlob(JSON.stringify(yourObject))]).getBytes()));
and read it back again like this
You can of course play this trick with the properties service too, which has a much lower property values size than cache service.
Since this is handful, it is implemented in my cUseful library.
Here's the key for the cUseful library, and it's also on github, or below.
And the above code could be rewritten as follows using crush and uncrush.
For more like this, see Google Apps Scripts snippets. Why not join our forum, follow the blog or follow me on twitter to ensure you get updates when they are available.
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Google Apps Scripts snippets >