Monday, December 20, 2010

About Browser Cache in IE

Recently i have observed that IE is making duplicate connections to get the same js file if it included twice. After making some experiments, I came to know that there is difference between Ctrl+F5 (Hard Refresh) and F5 (Refresh)

Ctrl+F5 (is intended to abandon all cached content and just retrieve all content from the servers again.)
In this case browser will overwrite the cache and it will not add the "If-modified-since" header to the request because of which it will get the file from the server everytime.

F5:
In this case browser by default adds the "If-modified-since" header to the request which will make the browser to get it from the cache.

So while taking Performance Readings in case of IE, we should be doing somethign like this:
1. Clear the cache.
2. Just F5(refresh) to get the actual response and normal browser behavior.

WebMarker


Recently i have been working on a bookmarklet which i have named it as Webmarker.

It will just work like a canvas on you webpage. You can draw anything on your webpage by using this tool. It still in its infancy stage.

It uses new HTML5 api. This bookmarklet might work with browsers that supports HTML5. You can download the pdf in which it shows sample work done by using this tool.

You can see the rose flower that i have drawn on a webpage using Webmarker.

Finding Max and Min values in an Array

To Find the min and max of an array, there is a simple technique by making use of javascript apply method which takes this object and an array of arguments.

To find the Max of an array
Math.max.apply(Math, [1,2,3,4,5,6,7,8]);

To find the min of an array
Math.min.apply(Math, [1,2,3,4,5,6,7,8]);