caching

Does Django cache templates automatically?

I'm new to Django and trying to implement a voting system between two images. However, it looks like the page is being cached or something because when I refresh it, some values are wrong. I have no cache setup in my Settings. Here is the View: def rate(request, type): photos = Photo.objects.order_by('?')[:2] c = Context({"ph...

Cache Line Alignment (Need clarification on article)

I've recently encountered what I think is a false-sharing problem in my application, and I've looked up Sutter's article on how to align my data to cache lines. He suggests the following C++ code: // C++ (using C++0x alignment syntax) template<typename T> struct cache_line_storage { [[ align(CACHE_LINE_SIZE) ]] T data; char pad[ C...

Browser fails to cache SWF file

I am having an issue with the browser not caching a SWF file. I have the following in my apache configuration: ExpiresByType application/x-shockwave-flash "access plus 2 months" I can see the headers coming back from the original request for the SWF look like this (the expires header looks like it's being set properly): Request: U...

create image cache - large png images

Hi all I am a first time poster. I have a problem that seems very common to a lot of people but I can't seem to find or decipher an answer anywhere. The game I'm making has 3 rather large sprites on screen (230 high) x various widths. Each sprite has 3 1024x1024 character sheets where the frames of animations are taken from. I've ex...

Caching only the ActionResult in ASP.NET MVC

hi, I want to cache the ActionResult object that returns by a controller in asp.net mvc. So i created a ActionFilterAttribute subclass named ResultCacheAttribute that uses the HttpContext.Cache as the cache provider. The cache worked but it also alters the processing flow: now the view engine CreateView method won't be executed, instead ...

NHibernate concurrency / cache problem

I have two applications running on a machine, where NHibernate is used as an ORM. One app is managing objects (CRUD operations), while the other is processing the objects (get, process, set status and save). First I let the processing app process an object and set the status to processed. Then I change a text property manually in the da...

Query Caching in MySQL

Ok, I am building a fairly large statistics system, which needs to allow users to requests statistics for a given set of filters (e.g. a date range). e.g. This is a simple query that returns 10 results, including the player_id and amount of kills each player has made: SELECT player_id, SUM(kills) as kills FROM `player_cache` GROUP BY p...

How to tell clicking "back" to load the cache?

I realize that you can't 100% know that this will work in all browsers. All I care about is IE 8, Chrome, and Firefox. I need some base headers that I can put at the top of my PHP pages to allow the Forward/Back buttons to load the cache. Update: on every page I have a logged in user box at the top of the page which gives the user acc...

sphinx is returning stale results

Environment: Memcached, Rails 2.2.2 + cache_money, Sphinx + thinking sphinx The following yields stale results: - add a record; mysql contains the correct data - the record is probably cached in memory at this point - re-index sphinx - sphinx returns the proper result with the correct data - edit the record - the cache is invalidated p...

Hibernate Second-Level Query Cache not working Eager Fetching

In NHibernate Profiler I observed that when I use eager fetching on an association, using "left join fetch" in an HQL Query or .SetFetchMode() in a Criteria Query the query no longer gets cached in the query cache. In fact from what I can see only very basic queries are cached. If anyone can give me some insight into what queries get c...

How best to manage Linux's buffering behavior when writing a high-bandwidth data stream?

Hi all, My problem is this: I have a C/C++ app that runs under Linux, and this app receives a constant-rate high-bandwith (~27MB/sec) stream of data that it needs to stream to a file (or files). The computer it runs on is a quad-core 2GHz Xeon running Linux. The filesystem is ext4, and the disk is a solid state E-SATA drive which sh...

Caching large number of pages on php site

I'm involved in a project that will end up creating around 10 million new pages on an existing site. The site, and the new project, are built with CodeIgniter and connecting to MySQL. I've never dealt with a site of this size before, and I'm concerned about how we should handle caching. Has anyone dealt with caching on a PHP site of thi...

Random access of multiple files and file caching

This relates to some software I've been given to "fix". The easiest and quickest solution would make it open and read 10 random files out of hundreds and extract some very short strings for processing and immediately close them. Another process may come along right after that and do the same thing to different, or the same, random files ...

CPU cache flush

I am interested in forcing a CPU cache flush in Windows (for benchmarking reasons, I want to emulate starting with no data in cpu cache), preferably a basic C implementation or win32 call. Is there a known way to do this with a system call or even something as sneaky as doing say a large memcopy? Intel i686 platform (P4 and up is okay as...

Flex TileList control, image loading issue

I have a flex 3 TileList in wich a load several image (employee's headshot pictures). The image I'm loading in the TileList are stored in a DataBase (I use the ByteArray class and a Base 64 encoding to store the images in the DB). When I load the images in the TileList from the DB, there is no problem they are displayed correctly, but ...

caching trouble: dynamic css files

I have some css files that need to be generated dynamically (why is complicated, but it's necessary). The easy solution is to change the files to aspx files, and use <%= %> tags as needed to inject the values I want. This works fine, until we get to caching. It seems that the browser and server refuse to cache the file. I've tried ...

What Are the Patterns and Best Practices for Caching in ASP.NET?

We are working on a large legacy application and we're redesigning the business layer and the data layer. We believe that it is a good time to redesign the way cache is handled. Are there any patterns and best practices for implementing a caching layer (or building it in the business layer)? The only things that I can think of are to us...

How to clear IconCache in windows7 via NSIS

Hi folks! I have a problem with installing of my application via NSIS in windows 7. Application installs successfully, but instead of myApplicationsIcon windows shows generic icon. I know how to fix this problem manually(delete IconCache.db in AppData\Local), but how can I do this with NSIS-script? Regards, Dmitry. ...

Persistence strategy for low latency reads and writes

I am building an application that includes a feature to bulk tag millions of records, more or less interactively. The user interaction is very similar to Gmail where users can tag individual emails, or bulk tag large amounts of emails. I also need quick read access to these tag memberships as well, and where the read pattern is more or...

Cached image problem

Hey all. Right, my problem is that I need to replace an image that appears on every page of a site, which is fine, the problem is I want every user to see the new image and not a cached version of the old one. This is made especially difficult because I can’t make any code changes (far too many places to do it for it to be viable) so I...