+Greg Piwowarski

Wednesday 5 December 2012

Cache

Hi Developers!

In many cases we can see a phenomena of getting faulty readings although everything is OK. For example, when American astronauts went to the moon, every time the capsule was going behind the far side of the moon, the controllers in Houston were receiving faulty indications about some readings that were fine just second ago and now they were implausible. So they were calling it the "dirty data". It was happening due to the radio signal being disrupted by the moon which at that time stood between the craft and the Earth.

Well guess what!

There is a similar phenomena in Web Design! It is called the cache. Cache is a handy memory space utilized by the browser that works as a buffer - some of the elements of frequently browsed websites (and in web design it's obvious that the websites are tested, controlled, viewed all the time) are saved to cache to increase the speed of loading the page. The reason is simple - to  enhance the download speed of the potential user's favorite sites. From this perspective cache is a good thing.

It has also one rather unhonest but life-saving property that I will discuss at the end.

The disadvantage of cache is that it could lead to a heart attack! Say you were asked by your boss to fix some issue and you do. You're happy, the page looks great on your machine and then you report to your superior. And then he tells you that it isn't done.

OR

You did some changes, you're sure they works and are done correctly and then suddenly after the refresh nothing is changing!

And why?

That happens because his cache is not refreshed or cleared and the browser uses the elements saved in cache to increase speed, but because of that it doesn't necessarily comply with the latest changes done to the project. The solution is usually to clear the browser cache.

I said that there is also one not necessarily honest but life-saving property of cache. If somebody had asked you to do something and you didn't do it because you have forgotten or whatever, you can always do it quickly and then blame cache! See you soon developers!

No comments:

Post a Comment