More tips for better caching

Here are a few more tips for getting your pages to cache better:

  • Include valid Date headers. We occasionally encounter servers whose Date headers are not valid. This tends to make caching difficult.

  • Include Last-Modified headers. Not all servers do this by default, although most have the ability to do so. We take advantage of this header, so include it.

  • If the content of your page has not changed, do not touch the file. Occasionally, people have programs that automatically rewrite a page that has not changed, only updating the time stamp in a comment somewhere. Unfortunately, this updates the Last-Modified date and forces the page to be retrieved again on both your M-Business Sync Server and M-Business Client on the mobile devices. Also, we do a checksum on the HTML before determining if it needs to be uploaded to the client. Changing a timestamp in the comment can affect that check as well.

  • Give each unique page a unique URL. If you are generating 20 stories each day, do not give them generic file names like story01.html and story02.html. Instead, give them unique names like 14mar00story01.html and 14mar00story02.html—this will make it easier for you to cache each page, because you do not have to worry about overlapping URLs.

  • On a more personal level, for the channels in your M-Business Anywhere account, update the Refresh setting so it refreshes, say, every 2 hours, instead of every synchronization. This only affects you personally. All it means is that if you are synchronizing your mobile device twice in a row within a short time period, your M-Business Sync Server will not bother updating your channel. Again, this does not affect the cache or improve performance for other users in any way. But if you happen to be synchronizing very frequently, this will improve synchronization time on your end. Incidentally, do not do this for channels you are currently testing. In those situations, you do want to update your channel every synchronization.