caching

What cache concurrency strategy should be used for @ManyToOne fields

What cache concurrency strategy should be used for @ManyToOne fields for a particular entity class. Would it make sense to use READ_ONLY instead of READ_WRITE, since these fields usually don't change after entity creation @ManyToOne(fetch = FetchType.LAZY) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) ... private User user; ...

Caching results from a PHP webservice for iPhone

I'm building an app that retrieves a JSON dataset from a PHP server. The app has a view that displays a "feed" of several different newly added or updated items from the web server. The app loads 20 of the newest items to start with, and the user can subsequently load 20 more older items, and 20 more, and so on. I want this data to per...

Generic wrapper for System.Web.Caching.Cache functions

I've created a generic wrapper for using the Cache object: public class Cache<T> where T : class { public Cache Cache {get;set;} public CachedKeys Key {get;set;} public Cache(Cache cache, CachedKeys key){ Cache = cache; Key = key; } public void AddToCache(T obj){ Cache.Add(Key.ToString(), ...

non-cached RSLs in Flex?

I have a project that is for several customers, the only difference is in the DB, everything else looks the same, except for the main page's text. That is loaded from an external swf file. I created a library, compiled it as an swc, imported it and using it as an RSL. The problem is that if once I've opened the page, and afterwards updat...

does django have a memory based cache or do you have to use memcache?

can I store objects in the servers memory to cache data using django, or do I have to use memcache for that? ...

Does the order of query string parameters affect cached objects?

Consider a request for... http://www.foo.com/bar?x=1&amp;y=2 ... and a subsequent request for... http://www.foo.com/bar?y=2&amp;x=1 Will a web browser consider them the same for caching purposes? ...

Can the .NET MethodInfo cache be cleared or disabled?

Per MSDN, calling Type.GetMethods() stores reflected method information in a MemberInfo cache so the expensive operation doesn't have to be performed again. I have an application that scans assemblies/types, looking for methods that match a given specification. The problem is that memory consumption increases significantly (especially ...

Performance comparison of MemCached with Disk Caching

Hi, I would like to know the performances of Memcached on remote server(on same LAN) with Disk Caching.Besides Memcached is a scalable cache solution, would there be any advantage of using Memcached with respect to performance when compared to disk caching. Regards, Mugil. ...

How to save the view count of a question in memory?

My website is like stackoverflow, there are many questions. I want to record how many times a question has been visited. I have a column called "view_count" in the question table to save it. If a user visits a question many times, the view_count should be increased only 1. So I have to record which user has visited which question, and ...

Why Rails.cache is not thread safe?

I know Rails.cache is ActiveSupport::Cache::MemoryStore, and it is not thread safe. I don't understand, why rails use a thread-unsafe cache as its default? Why not use ActiveSupport::Cache::SynchronizedMemoryStore? In my opinion, in a web site, if a cache is not thread-safe, it almost useless, because the requests are not handled in ON...

file_store of rails' cache

I am using the :file_store as rails' default cache, to hold the view count of articles, but I'm not sure the what's the performance of a file cache. Will there be any problem when handling some requests at the same time, and each request uses this cache? ...

NHibernate which cache to use for WinForms application

I have a C# WinForms application with a database backend (oracle) and use NHibernate for O/R mapping. I would like to reduce communication to the database as much as possible since the network in here is quite slow, so I read about second level caching. I found this quite good introduction, which lists the following available cache imple...

css background images blink after reload page

I have blocks on page with background images, when I refer (click link) to the same page-images blink. How can I set chache or something else to extract this problem? I tell about web http://pohladovybeton.sk/, especially in IE 8 after redirect (in page menus) is browser blink, and in Opera is blink content background, in FF is all OK a...

PHP: Measure size in kilobytes of a object/array?

Hi everybody, What's an appropriate way of measure a PHP objects actual size in bytes/kilobytes? Reason for asking: I am utilizing memcached for cache storage in my web application that will be used by non-technical customers. However, since memcached has a maximum size of 1mb , it would be great to have a function set up from the b...

Whats the point of using ob_start without any parameters in PHP

OK, I can see the use of ob_start with the output_callback parameter set but I can't see the use of ob_start when calling it without any parameters set at all. Whats the point of disabling output to later throw all the output at once? Don't this use more memory (server side) and slow downloads (client side) since the download starts onl...

Android getCacheDir in AsyncTask

Can I use getCacheDir() only in a class that extends Activity? I would like to use it in an AsyncTask so that I can do the time intensive cache file saving in it. Thanks Chris ...

How to quickly zip large files in PHP

Hi, I wrote a PHP script to dynamically pack files selected by the client into zip file and force a download. It works well except that when the number of files is huge (like over 50000), it takes a very long time for the download dialog box to appear on the client side. I thought about improving this using cache (these files are not c...

memcached-like key/value cache that uses both RAM and disk

I have a java web app that makes back-end use of a third-party web service. Calling the web service creates latency, which is important to avoid whenever possible. Also, my app is only allowed to make a certain number of web service calls per day, so it's best not to make a web service call unless absolutely needed. My current solutio...

Correct data structure to use for (this specific) expiring cache?

I need to read from a dataset which is very large, highly interlinked, the data is fairly localized, and reads are fairly expensive. Specifically: The data sets are 2gigs - 30gigs in size, so I have to map sections of the file into memory to read. This is very expensive compared to the rest of the work I do in the algorithm. From pr...

Keeping realtime views of cached content

Hi, I'm working on a busy web site. Sometimes it gets much more traffic then avarage days. The content is cached but as site's owner want to see realtime post views it has to do at least one query to MySQL per post view which is become performance problem under heavy load. All I can think of is create a different table for views and upd...