caching

How do I cache a find in a controller using memcache?

I have this method in a controller: def article_info if @article = Article.find_by_permalink(params[:permalink]) @title = @article.title @description = @article.excerpt @body = @article.body else render_404 end end I ultimately want to cache the results of Article.find_by_permalink so that query isn't executed ev...

Django cache_page checking

Hi, How can I confirm my Django views are being cached when I use the cache_page decorator like so: @cache_page(60) def my_view(request): Ideally I would like to output cache hit/miss messages in the console so I can confirm my view is being cached for 60 seconds etc. Many thanks, g ...

How do I know it's time to start using SQL Caching on my website?

I'm running a fairly new website that heavily consists user generated content. I have read about SQL caching and I'm just wondering when you know it's time to switch over to SQL caching. The site doesn't appear to be slow or anything but It would be great to hear what sorts of signs start appearing to warn me when I should start lookin...

How to set the cache expiry period of a whole folder of jpgs using .htaccess

How can I set the cache expiry date of a whole folder of images using .htaccess? Right now, I only want the contents of one specific folder to be given a long cache expiry date. I'm currently using the following code (pasted below), but I find it a pain because every time I add a new piece of art, I have to add it to this list. Is the...

Iphone Caching Problem

Hello, when I call -(IBAction)goback:(id)sender { NSURL *xmlURL=[NSURL URLWithString:@"http://demo.komexa.com/sicherungsbereich.xml"]; NSURLRequest *request = [NSURLRequest requestWithURL:xmlURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:2]; NSURLResponse *theResponse; NSError *theError; NSData ...

Changing OutputCache based on URL

I have got page which I would like to cache using the OutputCache directive. However, I am using a URL rewriter module to direct multiple URLs at this page, each with different contents. Is there any way to use the cache the output for each URL? There are no other criteria by which I need to vary the cache results. ...

C# HttpRuntime.Cache.Insert() Not holding cached value

I'm trying to cache a price value using HttpRuntime.Cache.Insert(), but only appears to hold the value for a couple hours or something before clearing it out. What am I doing wrong? I want the value to stay in cache for 3 days. HttpRuntime.Cache.Insert(CacheName, Price, null, DateTime.Now.AddDays(3), TimeSpan.Zero); ...

Memcache vs APC for a single server site data caching

I have a single server site thats pushing 200k unqiues per day, and the traffic doubles roughly every 40 days (for the last 5 months anyway). I pretty much only plan to cache the output of mysql_query functions for an hour or so. If cache is older than that, run query, put result back into the cache for another hour. My mysql DB is ab...

ASP.NET cache on client or server

If you set caching (as below) in an HTTP handler, will it be cached on the server or client or both? _context.Response.Cache.SetCacheability(HttpCacheability.Public); _context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(180)); ...

ASP.NET Clear Cache

If you cache pages in a HttpHandler with _context.Response.Cache.SetCacheability(HttpCacheability.Public); _context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(180)); is it possible to clear a certain page from the cache? ...

Disable caching on the client side in ASP.NET

Can you disable caching on the client side in a HttpHandler but enabling it on the server side? ...

What is the lifespan of the HttpRuntime Cache (any simple alternative?)

I have been using the HttpRuntime Cache for caching simple user preferences on an in house [dasboard] asp.net app that gets used by almost 200 users daily. I simply cache stuff such as the last query conditions, scales, options (just checkboxes dependent on other checkboxes etc.) just so that when a user closes the browser, they will be...

What type of java cache should be used in case data changes frequently?

I have a JSP which shows data by many aggregation types. E.g. By market, by category, by server type, etc.. What I have is the data by publisher and time. Publisher is the most granular level of data in my case. Now this data changes on every 1/2 an hour. The number of data per half an hour is almost 5K and anyone at a time looks data ...

Problem with caching (maybe) when using AJAX and PHP

Hi Firstly I tried fiding some similar posts but could not quite find anything. Mainly because I see this problem in FF and not IE only. I had a web page that was updating a mysql db no problem with some data. Then today, I switched the way it does this so that I can use an ID instead of a value, so for sizes, instead of small, medium ...

What's the best strategy to invalidate ORM cache?

We have our ORM pretty nicely coupled with cache, so all our object gets are cached. Currently we invalidate our objects before and after our insert/update/delete of our object. What's your experience? ...

ASP.NET datasets and memory

I am using framework 2.0, and I don't understand how the datagrid and the datasets works after doing a postback. In msdn says that there's no need to do a databind again if the request is a postback. But my question is: how the datagrid shows again the records if there is no databind? I supose that asp.net saves in a cache the query resu...

Java's WeakHashMap and caching: Why is it referencing the keys, not the values?

Java's WeakHashMap is often cited as being useful for caching. It seems odd though that its weak references are defined in terms of the map's keys, not its values. I mean, it's the values I want to cache, and which I want to get garbage collected once no-one else besides the cache is strongly referencing them, no? In which way does it h...

Using APC in PHP Version 6.0.0-dev

PHP 6 has APC included in the core distribution, but its off by default. I have compiled from source and tried '--enable-apc' but no luck. I also tried to download and compile the APC module but it fails. How do I turn APC on in PHP 6? ...

How to access thumbnail cache of vista and 7 using c#

Hi, I wanted to access the thumb cache of vista and 7 to be used in my ImageList. I know how to do it in XP by means of the thumbs.db files, but in vista and 7 the thumbs.db is not present so how will i do it? ...

nocache of linked Javascript

In my ASP.NET page I have <script src="Common2.js" type="text/javascript" ></script> How can I force the clients to never cache it so that it is always loaded fresh. ...