caching

What is an elegant way to force browsers to reload cached CSS/JS files?

I have noticed that some browsers (in particular, Firefox and Opera) are very zealous in using cached copies of .css and .js files, even between browser sessions. This leads to a problem when you update one of these files but the user's browser keeps on using the cached copy. The question is: what is the most elegant way of forcing the...

How to empty/flush Windows READ disk cache in C#?

If I am trying to determine the read speed of a drive, I can code a routine to write files to a filesystem and then read those files back. Unfortunately, this doesn't give an accurate read speed because Windows does disk read caching. Is there a way to flush the disk read cache of a drive in C# / .Net (or perhaps with Win32 API calls) ...

Is there an equivalent to ctrl-shift-r in Safari/WebKit?

I.e. something that would really reload the page or resource, ignoring whatever might be in cache. ...

How to force a web browser NOT to cache images

Background I am writing and using a very simple CGI-based (Perl) content management tool for two pro-bono websites. It provides the website administrator with HTML forms for events where they fill the fields (date, place, title, description, links, etc.) and save it. On that form I allow the administrator to upload an image related to t...

PHP object caching

In ASPNET, I grew to love the Application and Cache stores. They're awesome. For the uninitiated, you can just throw your data-logic objects into them, and hey-presto, you only need query the database once for a bit of data. By far one of the best ASPNET features, IMO. I've since ditched Windows for Linux, and therefore PHP, Python an...

Disabling client cache from Jetty server for REST requests

I have a REST Java server implemented with Jersey running on Jetty. It seems that certain browsers (IE7) internally caches all requests made to the server. What I would like to do is to send a certain HTTP header in the response from the REST server indicating the browser that it shouldn't cache that response, and so will query the ser...

Incorrectly set up APC for PHP?

I decided to install APC to speed up the site that I work for. Sadly, I found out that it was already installed and enabled(The developer who first worked on the servers has moved on). Then I decided to check the usage of it to see if it needs more memory allocated to it or not. This is when I discovered something weird. A simple file w...

Keeping a file in the OS block buffer

I need to keep as much as I can of large file in the operating system block cache even though it's bigger than I can fit in ram, and I'm continously reading another very very large file. ATM I'll remove large chunk of large important file from system cache when I stream read form another file. ...

Do fancy MVC URLs affect how caching is done?

When reading some answers to aquestion on clearing cache for JS files, somebody pointed to this part of the http spec. It basically says that URLS containing a ? should not be pulled from the cache, unless a specific expiry date is given. How do query string absent URLs which are so common with MVC websites (RoR, ASP.Net MVC, etc.) get...

Can you use multiple VaryByCustom parameters when caching a user control?

I've been trying this a couple of different ways, but it's not working for some reason. Is it even possible? ...

Fastest small datastore on Windows

My app keeps track of the state of about 1000 objects. Those objects are read from and written to a persistent store (serialized) in no particular order. Right now the app uses the registry to store each object's state. This is nice because: It is simple It is very fast Individual object's state can be read/written without needing...

What is the difference between Application and Cache in ASP.NET?

What the difference between Application("some-object") and Cache("some-object") in ASP.NET? ...

Best way to cache resized images using PHP and MySQL

What would be the best practice way to handle the caching of images using PHP. The filename is currently stored in a MySQL database which is renamed to a GUID on upload, along with the original filename and alt tag. When the image is put into the HTML pages it is done so using a url such as '/images/get/200x200/{guid}.jpg which is rewr...

How to purge expired items from cache?

I've got a nice little class built that acts as a cache. Each item has an expiration TimeSpan or DateTime. Each time an attempt to access an item in the cache is made, the item's expiration is checked, and if it's expired, the item is removed from the cache and nothing is returned. That's great for objects that are accessed frequently, ...

Caching in urllib2?

Is there an easy way to cache things when using urllib2 that I am over-looking, or do I have to roll my own? ...

How much Application session data can you actually hold?

I currently have an application that gets hit with over 20,000 users daily and they mostly look at one data table. This data table is filled with about 20 rows but is pulled from a "datatable" in a db with 200,000-600,000 records of information in the table. Edit: These 20 rows are "dynamic" and do change if the user enters in any infor...

Is it OK to use static variables to cache information in ASP.net?

At the moment I am working on a project admin application in C# 3.5 on ASP.net. In order to reduce hits to the database, I'm caching a lot of information using static variables. For example, a list of users is kept in memory in a static class. The class reads in all the information from the database on startup, and will update the databa...

Caching the sessionfactory

As far as I've gathered (read: measured), building the configuration and the sessionfactory by far takes the most time in executing a query using nhibernate. Is there anything against making the sessionfactory static, so it will only be configured once per appDomain? I know there are locking and racing issues when using this approach, b...

Implementing cache correctly in a class library for use in an asp.net application

I'm implementing a cache in a class library that i'm using in an asp.net application. I created my cache object as a singleton pattern with a static method to update the cache which is really just loading a member variable/property with a collection of data i need cached (got some locking logic ofcourse). I figured it was a nice way to...

How to properly implement a shared cache in ColdFusion?

I have built a CFC designed to serve as a dynamic, aging cache intended for almost everything worth caching. LDAP queries, function results, arrays, ojects, you name it. Whatever takes time or resources to calculate and is needed more than once. I'd like to be able to do a few things: share the CFC between applications define the scope...