caching

Second level cache for entities with where clause

I am wondering where the hibernate second level cache works as expected if I put a where clause in the hbm.xml class definition: <hibernate-mapping> <class name="com.clazzes.A" table="TABLE_A" mutable="false" where="xyz=5" > <cache usage="read-only"/> <id name="id" /> ... Will hibernate still put the id as key into the ca...

How to ignore query parameters in web cache?

Google Analytics use some query parameters to identify campaigns and to do cookie control. This is all handled by javascript code. Take a look at the following example: http://www.example.com/?utm_source=newsletter&amp;utm_medium=email&amp;utm_ter m=October%2B2008&utm_campaign=promotion This will set cookies via JavaScript with the ri...

free RSS feed caching

Hello I've got an application which serves an rss feed of headlines and I need to provide this rss feed to other consumers. I don't want to provide the rss directly from my server though, due to limited server resources (processing and also bandwidth), so I need to proxy (cache) it through some service which will handle most of the traf...

Generalized plugable caching pattern?

Given that it's one of the hard things in computer science, does anyone know of a way to set up a plugable caching strategy? What I'm thinking of would allow me to write a program with minimal thought as to what needs to be cached (e.i. use some sort of boiler-plate, low/no cost pattern that compiles away to nothing anywhere I might wa...

Java Caching on distributed environment

Hi, I am supposed to create a simple replicated cache using java for internal purpose which will be used in a distributed environment. I have seen oracle has implemented Replicated Cache Service. http://wiki.tangosol.com/display/COH32UG/Replicated+Cache+Service The problem I am facing is while doing an update or remove, I acquire lock ...

How to make per- http Request cache in ASP.NET 3.5

We using ASP.NET 3.5 (Controls-based approach) and need to have storage specific for one http request only. Thread-specific cache with keys from session id won't work because threads are supposed to be pooled and therefore I have a chance to have data from some previous request in cache, which is undesirable in my case. I always need to...

Help me understand entity framework 4 caching for lazy loading

I am getting some unexpected behaviour with entity framework 4.0 and I am hoping someone can help me understand this. I am using the northwind database for the purposes of this question. I am also using the default code generator (not poco or self tracking). I am expecting that anytime I query the context for the framework to only mak...

How do I cache WCF REST web service in IIS7?

When I turn on output caching for my service it doesn't appear to be cache-worthy in IIS. It really should be since I'm returning the same JSON content over and over. The varyByQueryString option seems like it would do the trick, but since my resources are URI based, there really isn't a query string, just a path to a resource. Has an...

.htaccess - proxy AND browser caching???

In .htaccess, how do I specify a file type to be cached via browser and proxy? Cache-control for needs to be "private" for browser, "public" for proxy. However, I can't define Cache-Control to be private AND public for same file type. It seems like I have to choose between browser or proxy caching. Suggestions? ...

Can squid cache objects based on object type?

The URL I get the images from are not dynamic but they end with aspx so I have added a refresh_pattern to cache them however if these URLs change in the future I need to change the config manually again. So I would like to know if squid can be configured to cache objects based on content type rather than URL so that no matter what they d...

Any way to profile code for cache behavior? (Windows / C++)

Hi all, as the title says I'd like to somehow get the cache behavior of my code. I'm running Windows 7 64-bit edition, compiling on Visual Studio 2008 Professional Edition, compiling C++ code. I understand that there's Valgrind under Linux, but are there any free alternatives I could use, or methods otherwise? Thanks! ...

How to prevent HTTP 304 in Django test server

I have a couple of projects in Django and alternate between one and another every now and then. All of them have a /media/ path, which is served by django.views.static.serve, and they all have a /media/css/base.css file. The problem is, whenever I run one project, the requests to base.css return an HTTP 304 (not modified), probably beca...

Where should I place a function that I want to run before the cached page is served (Drupal)

We have a intranet site that runs on Drupal. If an employee hits the site from outside our network they are required to login first. If they are already in our network, they can browse around freely. So we have a function that checks where they are coming from and redirects them to a login page if they are from outside. If we enable ...

How do set the max NSURLRequest data size that gets cached?

On the iphone, I'm using NSURLRequest and NSURLConnection to download images into my app. asynchronously. I also want these requests to be cached. What I've noticed is that some of my images do get cached and some don't. I'v implemented the delegate method -(NSCachedURLResponse *)connection:(NSURLConnection *)connection ...

How to use multiget with memcache in PHP

Hi! Just like the title, how would a multiget from memcache look like? Is this the correct way of utilizing multiget? : $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $var = $memcache_obj->get(Array('some_key', 'second_key')); Thanks UPDATE: anyone looking to do the same, check out this addition as w...

iPhone Caching Content on Device

Hello all, I have an app that builds a video from a large number of single frame images. These frame images are currently stored in a folder on my computer and when building my app in simulator I use the path to the folder to load the images. Now I'm building my App on the device and of course the device cannot find this path. Putting ...

how to get apache mod_cache work with mod_wsgi (django)?

I thought i'd speed up my django projects, by letting apache doing some caching for me. Unfortunately I see that apache never caches my dynamic pages. Has mod_cache problems with mod_wsgi served code ? My apache config: <VirtualHost *:80> ServerName myserver.com CacheEnable mem / # for testing only CacheIgnoreQueryString On Cache...

Disk-based caching of dynamic images in IIS 7

I'm writing an image server which needs to handle a relatively large number of concurrent requests (~5,000). The images being served are dynamically scaled down and cropped based on per-image specifications, which are queried from a database. The number of images is rather large, so an in-memory cache isn't viable (thrashing would most ...

Entity Framework 4 and Velocity

Hi. Did you ever used EF4 and Velocity(or other caching framework) together? I found this blog post Tracing and Caching EF. ...

Known problems with filemtime() on Windows - files getting touched arbitrarily?

Is there a known issue leading to file modification times of cache files on Windows XP SP 3 getting arbitrarily updated, but without any actual change? Is there some service on a standard Windows XP - Backup, Sync, Versioning, Virus scanner - known to touch files? They all have a .txt extension. If there isn't, forget it. Then I'm gett...