caching

Design options for a C++ thread-safe object cache

I'm in the process of writing a template library for data-caching in C++ where concurrent read can be done and concurrent write too, but not for the same key. The pattern can be explained with the following environment: A mutex for the cache write. A mutex for each key in the cache. This way if a thread requests a key from the cache ...

Can you cache a virtual function lookup in C++?

Say I have a virtual function call foo() on an abstract base class pointer, mypointer->foo(). When my app starts up, based on the contents of a file, it chooses to instantiate a particular concrete class and assigns mypointer to that instance. For the rest of the app's life, mypointer will always point to objects of that concrete type. I...

Cocoa Touch - How to cache a CGImageRef or UIImage (not using imageNamed:)?

I have a lot of images in my app so I decided to do some loading in a background thread, and since UIKit isn't thread-safe, I filled arrays with CGImageRefs. However, they are not cached and I need to be able to access them fast so my question is: How to cache CGImageRef, or cache the UIImage derived from it later on in the main thread?...

Caching of Live Data

Suppose I have a grid view in an asp.net web page, where I am showing some data from a database. These data have to be updated every 20 seconds. If multiple users log in to the same page, they will see the same data in that grid view. So, if, somehow I can cache those data, then it will be more faster in the multi-user scenario. In my g...

Problem with Hibernate find method

UPDATE: EXAMPLE TO CLARIFY I'm going to put an example of what's happening just to clarify the situation in my Spring + Hibernate application. Imagine I have this two entities (suppose getters and setters exists too) @Entity public class Class1(){ private Integer id; @OneToOne private Class2 object2; } @Entity public class Clas...

How to clear all cached items in Oracle

I'm tuning SQL queries on an Oracle database. I want to ensure that all cached items are cleared before running each query in order to prevent misleading performance results. I clear out the shared pool (to get rid of cached SQL/explain plans) and buffer cache (to get rid of cached data) by running the following commands: alter system f...

Caching is orthogonal to recursion... Explain ?

Although it's true that some recursive-nameserver configurations are (sloppily) referred to as "caching", e.g., by RHEL/Fedora/CentOS, that's a really bad name for that function -- because caching is orthogonal to recursion. Theoretically, you could write a nameserver that does recursive service but doesn't cache ...

How can I detach a process from a CGI so I can store and read files from memory?

Is it possible that I would be able to spawn a detached daemon like process, from a CGI script that stores read text files in memory, then re-access the memory in the next cgi execution, reading the data using a pipe? Would most hosting ISP's, allow detached processes? Are memory pipes fast, and easy to code/work with on a unix/linux sy...

PHP - Worth caching files in an array?

I have a Template Parser function which loads the raw html code of the template with the given name and replaces wildcards in it (%DATE%,etc). I will be using the same template more than once for some pages, e.g. a menu item, and so the html file would be loaded into memory more than once. So one file would be read more than once becaus...

Is there a way to check what's in the cache for Windows OS's?

I would like to see what is in the cache at any given time. Is there a way to check what's in the cache? ...

Do you expect that future CPU generations are not cache coherent?

I'm designing a program and i found that assuming implicit cache coherency make the design much much easier. For example my single writer (always the same thread) multiple reader (always other threads) scenarios are not using any mutexes. It's not a problem for current Intel CPU's. But i want this program to generate income for at leas...

NSURLCache Memory Size is zero

I am having trouble caching NSURLConnection responses using a synchronous call. I initialize the cache in one class and then use it in another. Notice how the cache memory capacity gets initialized to 100KB but then is magically reset to zero later. - (id)init { if (self = [super init]) { // Creates a custom URL cache that...

Affect of Content Deployment on Caching

Hi All , we are working on a website with three tier architecture. And the content store is a File System which contains the static content like images and all. We have two types of pages which contain static content and dynamic content but on the whole the page rendering is dynamic. The question is what will be the affect of accessing...

How should I include a remote page fragment in php in a performant way?

Hi there, I'm working on a site in Drupal which will reside at http://sub.clientdomain.com, pulling in an static html fragment from a server on at http://clientdomain.com/path/to/fragment.html, which I need to display in a page, to give a parent menu for a site. I'm working on a VPS, so I have access to curl, wget and pretty much anyth...

Alternative to SqlCacheDependency Notification with SQL Server 2005 because of its limitations and still avoid stale data or polling?

Hi geeks, i'm working on a big web project that still keeps evolving, therefor it uses "plain old" sqlcommands, rob connery's subsonic and linq to sql. most queries were written with sqlcommands back then, but new data access methods use linq to sql. we need to cache our data, because the web site is slowing down more and more. because...

iphone cache misses

Hi! is there a way to profile cache misses in an iphone application? http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/SharkUserGuide/GettingStartedwithShark/GettingStartedwithShark.html tells that there is a 'Hardware Measurements' Profiling mode in Shark which enables L2 cache miss profiling - however...

enable caching of images specifying a modified date

Hi.... I've a jsp page which loads many images. I'd like to cache the images for faster loading. I'll explain my idea, please correct it if it's wrong. I'm calling the picture loading servlet for each image and return as a BLOB. My idea is to add a modified date with the image and the other values like Last-Modified, expires, Cache-con...

Rails - Best way to implement Optionnal Fragment Caching for testing purposes

Hi, I'm using fragment caching a lot and it is essential to me for good performance. However, due to the complexity of the caching I'm using, I need to offer my testers, a way to disable/enable caching as a session variable. (On a user basis only) I was thinking about implementing a cache_disabled? method, and I now check for it's valu...

jQuery (or maybe the browser) is cache-breaking ajax loaded scripts

I'm loading a view page via an $.ajax() call with jQuery. I'm explicitly setting the "cache" option to true. Nowhere in the application are we using $.ajaxSetup() to specify otherwise. Here's the ajax request setup: $(".viewDialogLink").click(function() { $.ajax({ url: $(this).attr("href"), dataType: "html", ...

HTTP If-None-Match vs. If-Match

I'm currently building up a PHP script that will answer HTTP "304 Not Modified" when required. (See question #2086712 for what I do so far). Currently I answer to the following: If-Modified-Since If-None-Match But I found out that 3 more headers can trigger a "conditional GET" (See http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.h...