Client Cache Implementation using javascript