caching

How can I get parameters values from a lamba expression for my nifty cache extension?

First of all it might be worth looking at this question: http://stackoverflow.com/questions/445050/how-can-i-cache-objects-in-asp-net-mvc There some pseudo code that almost does what i want: public class CacheExtensions { public static T GetOrStore<T>(this Cache cache, string key, Func<T> generator) { var result = cache[key]; ...

rails caching for application.rb

I have a query that pulls stats which I would like to place on the footer of every page of my application. So natural I'm putting it in the application.rb, but the statistics in question don't change throughout the day generally... Basically in the footer it will say: Currently, 46 Countries, 75 Cities, and 20,000 locations. But I w...

Is there ever any reason to respond with "Vary: *" and "Vary: Foo" for the same resource?

Is there any reason for a HTTP server to sometimes respond with Vary: *, and sometimes with Vary: Foo, to requests for the same resource? What should a cache do, if after receiving (and caching) both responses, it then receives a request with a matching Foo header, for which the Vary: Foo response is suitable? Can it serve the matchin...

How to disable DNN module caching?

Hi I'm trying to customize DNN Html/Text module in following way: it should be invisible if there are specific parameter values in query string. The problem is if it gets rendered at once, it becomes visible always. I have run the web application in debug mode and found out that control Page_Load method is even not executed (other page ...

Best Practice when Caching files in Android

Hello all, I currently have my app caching image files in the cache sub-directory for the application. The images are used in a ListView and stored in a HashMap of SoftReferences to Bitmaps. So my question is this, what is the best way to cache these image files without inflating the space my application uses AND remains responsive fro...

Force Firefox to Reload Page on Back Button

How do you make Firefox rerun javascript and reload the entire page when the user presses the back button? I was able to do this in all browsers except Firefox from the help of another SO question by adding this code: history.navigationMode = 'compatible'; $("body").unload(function(){}) And also adding an iFrame... But this doesn't ...

My browser (FF, Opera) always display cache version while (Chrome, IE) not

My browser (FF, Opera) always display cache version while (Chrome, IE) not. My website does not send any cache header. I already double check it. I cleared the cache in FF and refresh page but it still display old page unless I add new parameter on query string (any parameter value). Ex: www.????.com/dev/test << it always display old p...

Caching function results in PHP

I'm making a simple tool to cache function results It look like: global $function_results; $function_results = array(); function getMembers($conditions, $default = array('order' => 'name', array('abc', 'def'))){ //****Help need from here****** //make unique id from parameters value and function name //ex: $uid; //****...

How to set Expires HTTP header on a single JS file in Apache Tomcat?

Hi, I have a js file which is cached between 5-10 minutes, depending on whether I'm using tomcat from the eclipse (via GWT plugin) or starting tomcat as standalone. This is strange as I'm using GWT as my framework and this file should not be cached at all (it's a nocache.js file to those of you who know GWT). I've read on a GWT Google gr...

2 basic computer questions

Question 1: Where exactly does the internal register and internal cache exist? I understand that when a program is loaded into main memory it contains a text section, a stack, a heap and so on. However is the register located in a fixed area of main memory, or is it physically on the CPU and doesn't reside in main memory? Does this app...

Cache page but count hits

I have an aspx page which counts every visit and creates a cookie. But if I use OutputCache page counts only the first visitor who requested the page. How can I prevent this bug? Page directive: <%@ OutputCache Duration="1200" VaryByParam="mode;page;sid;tid" %> Codebehind: protected void Page_Load(object sender, EventArgs e) { /...

Cache a Django view with GET parameters on a shared server

I'm developing a Django application on a shared server (Dreamhost). A view that I'm implementing takes several HTTP GET parameters to perform database lookups and return serialized data. Some of these lookups generate several hundreds of kilobytes of data that is expensive to compute. Caching this data would be ideal as it would save bo...

How to make favicon.ico Small and Cacheable?

I have a favicon.ico in my asp.net web application. It is small but how to make it cacheable? Any suggestion. ...

Tomcat Caching XHR responses

Hello All, I am using Apache Tomcat 6.0 as my development server. The problem that i am facing is that my application works very well on my development environment, but when i move it to staging the XHR is always picked up from cache except for the first time. I verified this using HTTP Watch and fiddler. Can someone Please help me in ...

NSData dataWithContentsOfURL cache

NSData +dataWithContentsOfURL has any kind of caching by default? Has anyone experimented some kind of problems using this method, what is the most efficient way to get Data from the web? ...

Prevent caching of .css files in UIWebView loaded from disk.

In the iPad project I'm working on I've got a UIWebView inside of the app which displays a .html file which links to a .css file, i.e. <link rel="stylesheet" href="style.css" type="text/css"> These files are stored locally on the iPad but are fetched from a remote server. I've noticed that UIWebView caches the .css file more or less ...

Properly setting up a simple server-side cache

I'm trying to set up a server-side cache properly and I'm looking for constructive criticism on the setup I have currently. The cache is loaded when the Servlet starts and never changed again, so in effect it's a read-only cache. It obviously needs to stay in memory for the lifetime of the Servlet. Here's how I have it set-up privat...

Can I clear a specific URL in the browser's cache (using POST, or otherwise)?

The Problem There's an item (foo.js) that rarely changes. I'd like this item to be stored in the browser's cache (using Expires header). However, when it does change, I'd like the browser to update to the newest version. The Attempt Foo.js is returned with a far future Expires header. It's cached on the browser and requires no round...

Caching for a single property or method in .NET

Using VB.NET on this one, in ASP.NET Web Forms. I have a property that reads a list from a database over the entity framework, as follows: Public ReadOnly Property MyProperty As List(Of MyType) Get Using service As New MyDatabaseService Return service.GetMyTypeList() End Using End Get End Property ...

clear phpThumb cache regularly with cron job

Hi there, I am using phpThumb on a client website, and as it is a very image heavy application the cache gets huge quick. Today the thumbs stopped working and I had rename the cache folder, as the folder was too big to delete via ftp. I renamed it cache_old and am trying to delete it now via ssh. I recreated the cache folder and ever...