caching

ASP.NET MVC 2 caching problem

Hi, I'm writing an app and have come across caching problem which I cannot work out. I have a default Home controller for the site which checks whether the user is authenticated or not. If is not then LogOn View is displayed otherwise the client is redirected to another page. Along with the LogOn view, also a Check cookie is being sen...

SQL Database Design - Cache Tables?

Hi there, What's a common/best practice for database design when it comes to improving performance on count(1) queries? (Im currently using SQLite) I've normalized my data, it exists on multiple tables, and for simple things I want to do on a single table with a good index -- queries are acceptably quick for my purposes. eg: SELECT c...

How to implement custom client-side wcf caching

I need to implement custom caching of client proxy of wcf service. I've implemented the IOperationBehavior interface. On server-side we can set OperationDescription.Invoke property in ApplyDispatchBehavior method and implement IOperationInvoker interface to control operation execution. On client-side we can't do it. In client-side we ca...

Rails: How can I cache system table data

Say I have a system table 'categories' with 2 fixed records. The user will not be allowed to delete these 2 but may wish to add their own to extend their list. I need to be able to pull out the 'garden' category at certain times, e.g when creating a garden project. A class attribute reader that returns the garden instance would do the j...

IIS keep cache for the longest possible time

Is the any option so I can specify the time that objects remain in cache? I'm facing performance issues since after some minutes of idle the responses to requests take a while to process. I believe this is due to the cache being cleaned. ...

can memcache be used only with one server?

i want to know if i can use memcache, but im only using one server, and i heard that memcache has to work with only 2 servers or more? i just want to clarify this? ...

Rails Cache Sweeper

I'm trying to implement a Cache Sweeper which would filter a specific controller action. class ProductsController < ActionController caches_action :index cache_sweeper :product_sweeper def index @products = Product.all end def update_some_state #... do some stuff which doesn't trigger a produ...

How can I change the CommonsWare cwac thumbnailAdapter to cache to the SD Card?

I am using Mark Murphy's ThumbnailAdapter in a project to cache and display images from the web in a list view. It works well, except that it caches to internal memory. I can't figure out how to modify it to cache to external memory. Any advice? cwac-thumbnail: http://github.com/commonsguy/cwac-thumbnail ...

Server side caching for redundant client data for Charting

The functionality that i have now enables me to generate charts(graphs/tables etc), from the XML data created by manipulating results extracted from the database. This works good when i have a limited amount of data. But as the data grows the time to generate charts increases substantially. Following is an example scenario that describ...

[nginx] Forcing user's browser to save files to cache

My website is a online music portal with online playing system. When user play a song, it is served by nginx server on port 8080 on my server. The problem is when the song has finished playing, the player repeats the song. But every time it replays, it makes another call to server and starts downloading the file again to play. Previ...

User Controls VaryByParam?

Does VaryByParam also take into account the control properties and the logged in user? Let's say, I have a custom property: will VaryByParam cache based on unique values to that property? Update: I've added the <%@ OutputCache Duration="500" VaryByParam="*" %> to my user control. In the page the control is embedded in, I have this code...

caching web service calls in MonoTouch

In Objective-C, I've used Three20's TTUrlRequest to enable some simple caching of my web service calls. I'd like to do something similar in MonoTouch, but it's unclear whether or not the MT implementation of HttpWebRequest supports caching. Using HttpWebResponse.IsFromCache causes a "Not Implemented" exception. I haven't been able to ...

correct HTTP response headers to cause 304s after content expiration

I'd like an HTTP response to expire 24 hours from now (meaning the browser won't make any requests for that URL until tomorrow). But, if the request is re-issued tomorrow after expiration, I want to make sure the browser will send the right request headers so that the server will send a 304 instead of forcing the client to re-download th...

Avoiding n+1 selects with Cached Hibernate Associations or Caching Collections as a whole

I've got a one-to-many relationship: Parent record with n Child records. These records are frequently used and read-only and are good candidates for caching. Here is an approximation of my Hibernate mapping: `<class name="Parent" table="Parent> <cache usage="read-only"/> <id name="primary_key"/> <property name="natural_key"/> ...

AppFabric Caching - Proper use of DataCacheFactory and DataCache

I am looking for the most performant way to arrange usage of the datacache and datacache factory for AppFabric caching calls, for between 400 and 700 cache gets per page load (and barely any puts). It seems that using a single static DataCacheFactory (or possibly a couple in a round-robin setup) is the way to go. Do I call GetCache("ca...

How to make the java system release Soft References?

Hi guys, I'm going to use a SoftReference-based cache (a pretty simple thing by itself). However, I've came across a problem when writing a test for it. The objective of the test is to check if the cache does request the previously cached object from the server again after the memory cleanup occurs. Here I find the problem how to mak...

How to cache dynamic PHP page

How to cache PHP page which has mysql query. Any example will be great and helpful. ...

Python: Is there any reason *not* to cache an object's hash?

I've written a class whose .__hash__() implementation takes a long time to execute. I've been thinking to cache its hash, and store it in a variable like ._hash so the .__hash__() method would simply return ._hash. (Which will be computed either at the end of the .__init__() or the first time .__hash__() is called.) My reasoning was: "T...

Loading Cache when Offline in Android Webview

Hi there, i have an application which loads urls from a website. Now i want that the aplication uses the cache when offline. But i just get the failure site which says that im not connected to the website. At first i set the Cachmode to Load_Normal but this doesnt help. Next i tried a realy "silly" approach using the ConnectivityManager...

Need clarification on how Session actually works?

At a lot of places I have seen the following pattern. Consider the code: Customer cust = (Customer) Session["Customer"]; //Do something to the object cust Session["Customer"] = cust and the code : Customer cust = (Customer) Cache["Customer"]; //do something to object cust Cache["Customer"] = cust; Now, in the second case, putti...