caching

How can I tell when a web page resource is cached?

Is there a way in JavaScript for me to tell whether a resource is already in the browser cache? We're instrumenting a fraction of our client-side page views so that we can get better data on how quickly pages are loading for our users. The first time users arrive on our site, a number of resources (JS, CSS, images) are cached by the bro...

Cache HTML Content by storing inside javascript variable in external js file?

I have a web application where the masterPage/template contains some static HTML that never changes but is sent with every request. (a lot of this HTML are hidden elements that are shown after a user does something) I'm wondering if there is some way of caching it? I was considering putting the HTML inside a javascript variable and doi...

Caching a column in a polymorphic relationship

I have content management system application that uses a polymorphic tree table as the core of its arrangement. I've come into a problem where once the tree grows quite large, and because we have quite a few different modules (about 25), just doing :include => :instance doesn't cut the mustard. Instance is the name of our polymorphic rel...

Pages disappearing from asp.net cache

I use shared hosting. I have set my page to be cached indefinitely. The page gets cached after the first request. However on the next day when I visit my site it is no longer in the cache and has to be regenerated. What is happening? Is the hosting removing my pages from the cache? Or something else? Any ideas? ...

Strange GWT behaviour in IE8

Hi, I experience a problem with GWT 1.6 in IE8 (I have enabled native XMLHTTP support). The scenario i this: The first time I enter a page, it renders fine with no problems. But in subsequent requests, the page fails with a JavaScript error: Message: Exception thrown and not caught Line: 5067 Char: 237 Code: 0 URI: http://someurl/some...

Basing ASP.NET Outputcache on querystring parameter AND session

I would like to know if its possible to use outputcache with a querystring parameter AND a session parameter together. I'm serving location based content and the countryid is stored in a session, while other parameters as categoryid, pageindex are stored in querystring. ...

Storing Null value in asp.net cache

This question is somehow related to one that I found here. In order to avoid round trip to the database I am caching the database output but in case of a null value, asp.net cannot make the difference between a value not set and an actual NULL value. I was wondering if instead of checking for the cache value for a specified key , we coul...

NHIbernate SysCache2 and SQLDependency problems

Hi, I've set enable_broker on my SQL Server 2008 to use SQLDepndency I've configured my .Net app to use Syscache2 with a cache region as follows: <syscache2> <cacheRegion name="BlogEntriesCacheRegion" priority="High"> <dependencies> <commands> <add name="BlogEntries" command="Sel...

Is it possible to cache JSP bytecode to avoid recompiles w/ Tomcat?

Hi, Is there any way of caching the bytecode for JSP webapps/ In particular, using Tomcat as the Java servlet? I'm getting really fed up of Tomcat taking up all the CPU for 10 minutes while it compiles 4 different webapps every time I restart it.... I'm already using Jikes to "speed up" the compiles, but it's really killing me. The cod...

Optimizing ARM cache usage for different arrays

Hi Folks, I want to port a small piece of code on ARM Cortex A8 processor. Both L1 cache and L2 cache are very limited. There are 3 arrays in my program. Two of them are sequentially accessed(size> Array A: 6MB and Array B: 3MB) and the access pattern for the third array(size> Array C: 3MB) is unpredictable. Though the calculations a...

Need help in data caching technique

Hi all, I am implementing how data caching work in asp.net. For that i have kept three button 1)cache date button, 2)currentdate button and 3)Cache Remove button. If I click on cache date button date will be cached for 2 minitues. if click on current date button current datetime will be displayed, and finally If I click on Remov...

Php template caching design

Hello to all, I want to include caching in my app design. Caching templates for starters. The design I have used so far is very modular. I have created an ORM implementation for all my tables and each table is represented by the corresponding class. All the requests are handled by one controller which routes them to the appropriate w...

how to retrieve value from cache file in php

i am storing web page in cache file. and i want to retrieve related data.but it does not work.every time it retrieve from database.how can i do this please help me. ...

Do you take a disk "hit" every time you retrieve a web.config value?

I have the following line of code called very often: var configValue = System.Configuration.ConfigurationManager.AppSettings["ConfigValueKey"]; Do I take a disk hit for ASP.Net to retrieve the item from the web.config, or is it smart enough to cache the value in memory and only refresh the cache when the web.config changes? ...

Cache frameworks for .NET

I'm planning to develop a web service, i need to use in memory cache, what different caching frameworks are available out there for .NET, i have used Microsoft Enterprise Library Cache block and also evaluated NCache for distributed environment. My core requirement is reliability with Cached data, i was thinking of using Enterprise Lib...

Safari caching pages too heavily, how to add expires header using rails

I'm page caching the majority of my pages and using a dynamic js file to inject the user specific content. So in my header file I have something like this: <%= javascript_include_tag '/dynamic_header/current' %> What this will do is execute the dynamic_header controller show.js.erb view which gets returned alongside the page and hand...

Ruby on Rails form page caching including authenticity_token

I have a simple Ruby on Rails form which includes an authenticity_token. Unfortunatly, I missed that when you page cache this page then the Authenticity Token becomes invalid. I'm glad I figured it out however. How do you solve caching in such a case? ...

Md5 cache keys in Memcache

In this reddit blog post, the author talks about MD5ing the cache keys and hence the reason why they find it very difficult to scale out. Can someone tell me why one would want to md5 cache keys? I didn’t understand the reason even though they explained it as “A few years ago, we decided to md5 all of our cache keys. We did t...

Why is Rack::Cache not hitting cache when etag matches?

Starting with no cache on server or client FIRST REQUEST GET /post/1 HTTP/1.1 HTTP/1.1 200 OK Date: Fri, 05 Mar 2010 09:05:46 GMT Last-Modified: Thu, 04 Mar 2010 21:00:08 GMT X-Rack-Cache: miss Etag: "c226165d5817af7c91592dab0bc0ac63" Cache-Control: max-age=3600, public The Cache is missed and Rails gets hit and queries the database...

How to remove smart pointers from a cache when there are no more references?

Hi, I've been trying to use smart pointers to upgrade an existing app, and I'm trying to overcome a puzzle. In my app I have a cache of objects, for example lets call them books. Now this cache of books are requested by ID and if they're in the cache they are returned, if not the object is requested from an external system (slow operati...