Questions tagged [memcached]

Memcached is a simple distributed object cache that caches information in memory, and can be used to improve the performance of dynamic web applications by reducing access time and database load.

Memcached is open source easily deployable in-memory distributed cache, cross application and cross Platform Engine meaning the same server(s) can be accessed from a variety of languages - PHP, Java, and .NET and from Windows, Linux, etc. Memcached is currently distributed under a BSD-style open source license.

5184 questions
91
votes
3 answers

How do I tell Spring cache not to cache null value in @Cacheable annotation

Is there a way to specify that if the method returns null value, then don't cache the result in @Cacheable annotation for a method like this? @Cacheable(value="defaultCache", key="#pk") public Person findPerson(int pk) { return…
David Zhao
  • 4,284
  • 11
  • 46
  • 60
90
votes
11 answers

Can I get Memcached running on a Windows (x64) 64bit environment?

Does anyone know IF, WHEN or HOW I can get Memcached running on a Windows 64bit environment? I'm setting up a new hosting solution and would much prefer to run a 64bit OS, and since it's an ASP.Net MVC solution with SQL Server DB, the OS is either…
RobertTheGrey
  • 8,645
  • 5
  • 32
  • 45
90
votes
2 answers

If redis is already a part of the stack, why is Memcached still used alongside Redis?

Redis can do everything that Memcached provides (LRU cache, item expiry, and now clustering in version 3.x+, currently in beta) or by tools like twemproxy. The performance is similar too. Morever, Redis adds persistence due to which you need not do…
DhruvPathak
  • 42,059
  • 16
  • 116
  • 175
89
votes
7 answers

PHP memcached Fatal error: Class 'Memcache' not found

I've pasted the example from php.net for using memcached in php and I'm getting: Fatal error: Class 'Memcache' not found I have this in my php.ini: [memcache] memcache.hash_strategy = "consistent" memcache.max_failover_attemps =…
jpfuentes2
  • 2,085
  • 1
  • 18
  • 19
85
votes
7 answers

Installed memcached via homebrew, how to start and stop server?

I have memcached installed via homebrew. how do I start/stop the server? Any command-line tools to interact with memcached? does homebrew have a way of removing a package?
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
83
votes
11 answers

Memcached with Windows and .NET

Is there anyone already implement memcached for production use in Windows environment? Because many blogs that I've read, it's not recommended to run memcached in Windows especially for production use, for example running memcached on windows. And…
Funky81
  • 1,679
  • 4
  • 18
  • 24
80
votes
4 answers

Rails.cache.clear certain key names?

Is it possible to somehow run Rails.cache.clear and only clear keys with a certain name/string? I don't want to clear the entire cache...just keys with the string blog/post in the name (ie. blog/post/1, blog/post/2). I'm using dalli with memcached…
Shpigford
  • 24,748
  • 58
  • 163
  • 252
76
votes
10 answers

Error when install pylibmc using pip

Hello when I attempt to install pylibmc on OSX Lion using pip I get the following error: ./_pylibmcmodule.h:42:10: fatal error: 'libmemcached/memcached.h' file not found #include ^ 1 error generated. error:…
harristrader
  • 1,181
  • 2
  • 13
  • 20
64
votes
4 answers

Is it recommended to store PHP Sessions in MemCache?

I'm working with a couple of Web Servers behind a Load Balancer and I can enable Sticky Sessions to hold a user to the one specific Web Servers - this will work. I have been reading about PHP Sessions & MemCache. I must say what I've read is a touch…
Adam
  • 19,932
  • 36
  • 124
  • 207
60
votes
3 answers

Memcache vs Java Memory

Simple, probably dumb question: Suppose I have a Java server that stores in memory commonly used keys and values which I can query (let's say in a HashMap) What's the difference between that and using Memcache (or even Redis)? They both store things…
Henley
  • 21,258
  • 32
  • 119
  • 207
53
votes
7 answers

Java Memcached Client

Which is the best Java memcached client, and why?
Java Guy
  • 3,391
  • 14
  • 49
  • 55
53
votes
15 answers

alternative to memcached that can persist to disk

I am currently using memcached with my java app, and overall it's working great. The features of memcached that are most important to me are: it's fast, since reads and writes are in-memory and don't touch the disk it's just a key/value store…
Mike W
  • 747
  • 2
  • 7
  • 10
52
votes
8 answers

Memcache maximum key expiration time

What's memcached's maximum key expiration time? If I don't provide an expiration time and the cache gets full, what happens?
cfischer
  • 24,452
  • 37
  • 131
  • 214
50
votes
12 answers

Laravel Lumen Memcached not found

Ok, I just started with Lumen and I'm trying to use the Auth, but a call to either Auth::check or any other function of Auth.. leads to the below Error Fatal error: Class 'Memcached' not found in vendor\illuminate\cache\MemcachedConnector.php on…
Paul Okeke
  • 1,384
  • 1
  • 13
  • 19
47
votes
4 answers

Rails.cache error in Rails 3.1 - TypeError: can't dump hash with default proc

I running into an issue with the Rails.cache methods on 3.1.0.rc4 (ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10]). The code works fine within the same application on 2.3.12 (ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux], MBARI…
shedd
  • 4,198
  • 4
  • 33
  • 42