Developers
AvantGo Channel Developer Guide

TOC PREV NEXT INDEX


Caching guidelines

I am sure that, like any good channel developer, you are constantly thinking about the best way to cache your content. If you were hiking in the woods and you suddenly walked between a grizzly bear and her two cubs, the first thought that should go through your mind is, "Will this affect the caching of AvantGo channel?"

Cache any static pages in a personalized channel as usual

At first glance, it might seem like a personalized page is uncacheable. After all, there is no way of predicting when a user will change his preferences. And that much is true. But there are still some steps you can take to improve the cacheability of a channel. For instance, in the Movie Review Channel, while the front page may change all the time, the movie reviews it points to are all static and can be set to cache for long periods of time.

Cache personalized pages on the mobile device

Second, you can add a Cache-Control: private header onto the result of your frontpage.pl and editprefsform.pl scripts. This means that the pages are cached on the mobile device (but nowhere else). The AvantGo sync server will always execute frontpage.pl every time a user syncs (because there is no max-age), but it will take a look at the resulting HTML page and compare it to what exists on the user's device. If they are exactly the same, it will not bother uploading the page onto the mobile device again, thereby saving a good chunk of time.

Figure 7-5 Caching Movie Channel pages

For more information about caching, be sure to check out CHAPTER 5. Caching to improve channel performance.



TOC PREV NEXT INDEX