AJAX-Tips
Caching with an Ajax based website will always be a challenge for developers. Browsers will always have their own caching technology which is a little bit unfortunate because of its variety.
Mozilla based browsers have been smart enough in dealing with caching in Ajax by limiting the streaming information. On the other hand IE have problems with caching as the browser will constantly be updated with the data. IE will always be updated with data but they will never be shed. Since it will be stored continuously, the temporary files will increase which could slow down the Ajax based operation.
Developers have already found a way on how to deal with this problem. Preventing cache in IE has been really easy. Simple coding would be more than enough to disable continuous caching in IE.
However that would mean developers have to create two versions of coding for different browsers, which would mean additional time in development that could delay the development process of an Ajax based website.
But caching is very important in a website as it will assist users in building a user friendly website. Ajax needs caching more than ever because it could release a lot of information in no time. Although it could easily stream information, in needs caching so that retrieval of information could come from the user’s browser instead from the server – saving bandwidth while increasing connectivity.
We cannot live with continuous caching, on the other hand, we cannot expect a good website without one. We have to come up with a smart solution in caching. Smart caching should be done so that an Ajax based application is possible. This will not only be beneficial for IE since it could prevent continuous caching but it will also benefit Mozilla based browsers by improving the experience of users.
Smart caching is basically reversing the behavior of caching in any browser. The usual behavior is that browsers will only cache the data that was used. After reading the data, watching the video and looking at the pictures, browsers will keep that data for future reference. But that does not make sense if you carefully think about it. Since you have already looked at data, why would you take a look at the data again? It would be possible for simple information but pictures and videos do not have to be cached for future reference.
Instead of caching after it used, developers could cache the data – specifically video and picture before they are used. The coding goes this way:
<SCRIPT LANGUAGE="JavaScript1.1" TYPE="text/javascript">
img1 = new Image();
img1.src = "filename";
img2 = new Image();
img2.src = "filename2";
</SCRIPT>
This code could be loaded in a page where the data will be loaded. Instead of waiting for the pictures and videos preferred by users, developers could actively cache the pictures and videos so that it could be available for the users fast. This type of caching could run at the background while the browser loads the initial or the homepage. It is a simple code but could do wonders in any type of browser.