caching

IIS cache with PURGE support

On Unix, I normally deploy nginx in front of Varnish in front of my application server. Both nginx and Varnish are acting as reverse proxies here. Varnish maintains a cache and supports things like If-Modified-Since, Cache-Control response headers and PURGE requests from the application. nginx is good at receiving a lot of connections. I...

Caching Large Datasets

I'm working on an ASP.NET application that has the following requirements: Once every 15 minutes perform a fairly expensive query of around 20,000 items (not from a database). Has around 10 columns, all short strings, except for one which stores up to 3000 char (usually a lot less). Process the resulting DataTable with various sorting ...

Why is Rails' asset cache not working for JS in the staging environment?

I have my CSS and JS set to cache in RAILS_ROOT/app/views/layouts/application.html.erb: <%= stylesheet_link_tag 'reset', ... 'layout', 'colors', :cache => 'cache/all' %> <%= javascript_include_tag 'jquery-1.3.2.min', ... 'application', :cache => 'cache/all' %> If I turn on caching in ...

Rome FeedFetcher Cache

I am trying to use Rome FeedFetcher to retrieve an RSS feed only if it has been updated. However, once the cache is created, it never seems to check the feed again. So if an item is added to the feed it isn't pulled down. I turned on some logging and looked at: feedFetcherCache.getFeedInfo(url).getLastModified() for the url in ques...

User Stats: "interative calculation" or bulk calculation + caching

I have a project that calculates a number of 'statistics' about a users performance and then shows it to them. All these statistics ultimately come from a large table of 'interactions' that record the users interaction with the site. At the moment, all these statistics are calculated by looking at this data. We make extensive use of p...

C# Caching is dropping rows when synchronizing to the database.

Hi all, im using temporary table to hold data to display it in gridview and then from that table to database, im using cache for this process. Problem : sometimes one record from the table is not loading into the database. if im using break point its working. if (Cache["Info"] != null) { Table = (DataTable)Cache["Info"]; ...

Visual Studio, change app icon, how?

Hi, I am working on a first time C# project in Visual Studio 2005 and I am wondering if there is anything special that needs doing to change the application icon apart from changing the correct resource in the project properties. I manage to view the new icon displayed in Explorer, but the icon in the application, the tray, and the tas...

IIS/Cache problem?

I have a program that checks if a file is present every 3 seconds, using webrequest and webresponse. If that file is present it does something if not, ect, that part works fine. I have a web page that controls the program by creating the file with a message and other variables as entered into the page, and then creates it and shoots it o...

Java: Cache results of computation?

I'm writing a program to calculate a value that is a measure of the similarity between two objects. The comparison is commutative, so compare(a, b) == compare(b, a). The program's output to the console is a matrix of all results. However, since the matrix has each comparison twice ((a, b) and (b, a)), I'd like to save time by only calcu...

.NET: caching in database or filesystem with a CacheDependency

I would like to know if there is a way to use .NET's CacheDependency infrastructure, but cache to a database table or file, rather than the in-memory cache. I think the Enterprise Library may be able to do this but I would prefer something simpler if possible. I want the cached data to be put in an SQL table or into a file on disk, rath...

Which is better caching data with a file or a sqlite database?

I am caching data in an application I am currently writing and was wondering which would be better to use a regular text file or a sqlite database to hold the cached data? Thanks. EDIT: I am using Zend_Cache so relationships are handled without the need of database. What I am caching is xml strings if saved as regular files can be as b...

Hibernate: How to eagerly fetch un-associated entities?

Java Persistence with Hibernate shows lots of examples of how to eagerly fetch associated entities, such as: Adding @org.hibernate.annotations.BatchSize to the associated class Adding @org.hibernate.annotations.Fetch to the field that references the associated class Using the "fetch" keyword in the HQL query, etc... However in my cas...

Force Application refresh on back button

I have a web app which pulls in information via ajax after the page loads. When a user leaves the page, then hits the 'back' button in their browser, they see the page as it looked on initial load. What I need to have happen is have all javascript run as if they hit the 'refresh' button. I have tried setting the Cache-Control and Pragm...

Hibernate: Clean collection's 2nd level cache while cascade delete items

I have a problem Hibernate does not update 2nd level cache for a collection of items which are subject of cascade removal. Details Assume we have an object Parent which has Parent.myChildren collection of Child objects. Now we have also object Humans with Humans.myAllHumans collection and all Parent and Child objects are in that collec...

Prevent Ruby on Rails from sending the session header

How do I prevent Rails from always sending the session header (Set-Cookie). This is a security problem if the application also sends the Cache-Control: public header. My application touches (but does not modify) the session hash in some/most actions. These pages display no private content so I want them to be cacheable - but Rails alway...

how to prevent css and js being cached by internet service provider ?

Hi, I got "dump" isp that always cached internet pages and its css for at least 1 day. Although the css / js in the server changed, the presented css are not changed (i have been clear my cache everytime) how to "tell" my isp not to cache some files like css and js ? thank you !! at the moment: i'm using proxy to check a under deve...

Need a solution for middleware caching in C#

I have an ASP.net application that uses some common business object that we have created. These business objects are also used in a few other windows services or console applications. The problem I am running into is that if I have a class "foo" and a class "bar" and each has a function loadClient(), if I call foo.loadClient() and bar.l...

How can we stop web page view after signout using browser back

Hi All, I am having web site in ASP.NET. We have two type of login 1. Users 2. Administrator I am facing following problem during testing Problem statement: Suppose i loggedin by user login and surf all pages, let say at any page of user i click on logout button, it will redirect me at login page. Now the problem comes when i use br...

What can I do in Java code to optimize for CPU caching?

When writing a Java program, do I have influence on how the CPU will utilize its cache to store my data? For example, if I have an array that is accessed a lot, does it help if it's small enough to fit in one cache line (typically 128 byte on a 64-bit machine)? What if I keep a much used object within that limit, can I expect the memory ...

Preloading/precaching images with JS isn't working the way I want it to; what am I doing wrong?

I'm trying to preload about 200 images using the following: var total_images = 0; var loaded_cnt = 0; var tempImg = new Object(); function precache_array(a,path){ for(var i = 0; i < a.length; i++){ tempImg[path + a[i]] = new Image(); tempImg[path + a[i]].src = path + a[i]; tempImg[path + a[i]].onLoad = image_loaded(a...