Cache implementation using JavaScript