caching

How to use cache in Rails for other formats than xml (like csv)?

I have a rails controller which must return a .csv file and I'd like this page to use cache. The cache works fine when I use a .xml format (it returns 304 http status), but when the format is csv, it always returns 200 http status. here is my controller code: def index @machines = Machine.all respond_to do |wants| want...

How to tell Facebook to remove Javascript cache.

So, i m working on a facebook app. It has javsacript. Of course, FB will sanitize the javascript. Of course, FB cache the javascript. Whenever I upload the js file, it takes a while or a long while for the new javascript to take affect. That's annoying for development. :( so, anyone know how to notify FB (vai API or some FB js call) ...

Asp.net Cache Dropdown Data on Client

We would like to cache data for some dropdown lists on the client machine to reduce the transfer of slow changing info. This data will be used on multiple pages within a business app so for example a customer list of 5,000 customers is frequently used either for searching, creating a sales order, or other purposes. We've tried both full...

Is it a good idea to warm up a cache in the BEGIN block in Perl?

Is it a good idea to warm up cache in the BEGIN block, when it gets used? ...

How do I read Safari's cache.db through Active Record?

What I Want I want to read the cache of Safari through Active Record. Essentially, I want to peek inside the cache like this except from within a Rails app. What I've Tried I copied the Cache.db file I set up the environment.rb file in a new Rails app with the path of a copy of the Safari Cache.db SQLite Database. Ran db:migrate Thi...

Invalidating the CPU's cache

When my program performs a load operation with acquire semantics/store operation with release semantics or perhaps a full-fence, it invalidates the CPU's cache. My question is this: which part of the cache is actually invalidated? only the cache-line that held the variable that I've used acquire/release? or perhaps the entire cache is in...

Session overload - what is "too much data" stored in a session in PHP?

I'm using the session array to cache chunks of information retrieved from the db: $result = mysql_query('select * from table'); array_push($_SESSION['data'],new Data(mysql_fetch_assoc($result))); My question is, is there a limit/a sizeable amount of information that can/should be passed around in a session? Is it ill advised or signif...

cache.fetch in Django?

Does Django caching have a method similar to Rails' cache.fetch? (http://api.rubyonrails.org/classes/ActiveSupport/Cache/Store.html#M001023) The rails cache fetch works like: cache.fetch("my_key") { // return what I want to put in my_key if it is empty "some_value" } It's useful because it checks the cache, and returns the value ...

Haskell caching results of a function

I have a function that takes a parameter and produces a result. Unfortunately, it takes quite long for the function to produce the result. The function is being called quite often with the same input, that's why it would be convenient if I could cache the results. Something like let cachedFunction = createCache slowFunction in (cachedFu...

Different style for anchor tag when clearing the browser cache

when i click on anchor tag - a dotted border come around my anchor text. the is is coming in IE7,IE8 and firefox. I have used. a{ outline:none; } this works as expected.But i need to clear the cache of my browser. Unless and until i don't clear the cache in my browser that dotted line appears around my anchor text. Could anybody ...

Hibernate Filters break the second level cache

I've a collection mapped, which caches fine in the L2Cache. As soon as I apply a filter to the collection, the L2Cache is not used. I can't use a where clause in the collection as I need it to be more dynamic than that. Anyone have any ideas ?? ...

Prevent filesystem caching for MySQL queries

Hi. When i disable query cache in mysql, queries still cached. As I understand it is because of OS filesystem cache. How can i prevent filesystem on cache this data. I working on WIndows 7 but it might be the Linux. ...

How google suggest caches queries on client side?

Well, I was playing with Google query auto completion and noticed funny thing: if I for example type in "m" letter, it performs Ajax jsonp query. Then if I'll refresh my page and enter "m" letter again there would not be any query. The same thing happens with longer sequences of letters. It's obvious that Google uses some client-side ca...

size of NSCachesDirectory in iphone

how do i get size of folder NSCachesDirectory i.e /Library/Cache. i want to know size of this folder so that i can eventually clear this. thanks. Edit: here is my code. NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:folderPath error:&error]; if (attributes != nil) { if (fileSize = [attributes ob...

Reference for the benefits of Caching

I am looking for a good reference (Paper, Blog, Book etc.) on how a good caching strategy could benefit - especially web based - applications. I know it is always application specific but I just want to quote some figures about the performance gains possible (or when it doesn't make sense). Would be great if you had some input for me. ...

storing huge amount of records into classic asp cache object is SLOW

we have some nasty legacy asp that is performing like a dog and i narrowed it down to because we are trying to store 15K+ records into the application cache object. but that's not the killer. before it stores it, it converts the ADO stream to XML then stores it. this conversion of the huge record set to XML spikes the CPU and causes a...

MySql cache problems... some questions

First of all, I am using PhpMyAdmin, is this okay or not? Because when I have cache disabled, and do two queries after eachother, the second query always is faster, so I am thinking maybe there is an internal cache on PhpMyAdmin? Secondly, is there any way to get the time of how long a query takes, into php, and echo it onto the browser...

query_cache_min_res_unit; What is it and what does it do?

I am setting up cache in MySQL. Could someone please explain query_cache_min_res_unit? What does it do etc? I have read the manual and it doesn't explain so good. Details are appreciated... Or examples... Thanks ...

How to clear APC cache without crashing Apache?

If APC stores a lot of entries, clearing them crashes httpd. *If apc_clear_cache('user') takes longer than phps max_execution_time the script calling apc_clear_cache will be terminated by php before the clearing-operation is finished. this seems to leave some handles or sth. that will prevent apache from closing it's proc...

Get MySql result-set size from query using PHP

Is it possible to get the size of the result-set when doing a query? I need to set a proper MySql cache_limit (MB) and therefore I am trying out some queries, but I need to know the sizes of the result-sets to fine-tune my cache configurations. What exactly does query_cache_limit do when measuring the size of a query (or result)... An...