Use Cases for DataCache

I discussed a set of use cases not well supported by HTML5 ApplicationCache with the HTML WG during a breakout session at TPAC. These use cases were the basis for AtomDB are being solved by the DataCache API.

Found out that OMA and AT&T had similar ideas too. Also learnt that these techniques could be merged with HTTP caching.

Hixie agreed these use cases covered the ones the GMail team had asked for but he favored waiting until after AppCache had stabilized and browser implemented other HTML5 stuff.

I have overheard that IMHO, the data URLs that would have to be cached would usually be requested using AJAX. Hence, this functionality can be achieved with a combination of AppCache and WebDatabase specifications. Since we really don’t care about what type of data the server returns, we can’t be sure if there is a case of interoperability here.

I also received an e-mail asking: How would you show a thumbnail of an image that you may have downloaded as the attachment for an email? That would require you to use an <img> tag. Not everything can be put through Ajax requests.

To that I say, Dynamic thumbnails today are usually downloaded a image sprites to save the number of HTTP connections made to the server. In our given context, to show (and cache)dynamic image data, AJAX requests are made, with responses returning data URIs of the images. The returned result can be stored and displayed with AJAX.

For really large images (and for IE that does not support data URIs), the base64 image data can be sent and drawn on canvas with Javascript. Improvements like JPEG decoders written in Javascript are also an option when encoding is required.


  1. By Griff


Leave a Reply

Your email address will not be published. Required fields are marked *