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
35
votes
8 answers

Maximum size of object that can be saved in memcached

I need to return a rather big file (11MB) to the user. For certain reasons, I can't just provide a direct url to the file (http://www.sample.com/mybigfile.exe); instead it must be accessed through code. Instead of having to read it from disk over…
cfischer
  • 24,452
  • 37
  • 131
  • 214
34
votes
9 answers

Clear Memcached on Heroku Deploy

What is the best way to automatically clear Memcached when I deploy my rails app to Heroku? I'm caching the home page, and when I make changes and redeploy, the page is served from the cache, and the updates aren't incorporated. I want to have this…
Solomon
  • 6,145
  • 3
  • 25
  • 34
34
votes
5 answers

best place to clear cache when restarting django server

I want memcached to be flushed on every restart/reload of django server. I use cherrypy for production and builtin server for development. I would add this to settings.py, right after CACHES: from django.core.cache import cache cache.clear() but it…
Motiejus Jakštys
  • 2,769
  • 2
  • 25
  • 30
34
votes
4 answers

what are pagecache, dentries, inodes?

Just learned these 3 new techniques from https://unix.stackexchange.com/questions/87908/how-do-you-empty-the-buffers-and-cache-on-a-linux-system: To free pagecache: # echo 1 > /proc/sys/vm/drop_caches To free dentries and inodes: # echo 2 >…
Rakib
  • 12,376
  • 16
  • 77
  • 113
33
votes
3 answers

MS Velocity vs Memcached for Windows?

I've been paying some attention to Microsoft's fairly recent promoting of Velocity as a distributed caching solution that would compete with the likes of Memcached. I've been looking for a 64bit version of Memcached for Windows for some time now…
RobertTheGrey
  • 8,645
  • 5
  • 32
  • 45
32
votes
4 answers

memcache and wildcards

I'm just wondering if there is a way to clear memcache using wildcards for key values. So say I have a cache with the key "1234~foo" and another "1234~foo~bar". Is there any way I can say clear the cache by using something like clear("1234*") and…
GivP
  • 2,634
  • 6
  • 32
  • 34
31
votes
2 answers

Best practice for keeping data in memory and database at same time on Android

We're designing an Android app that has a lot of data ("customers", "products", "orders"...), and we don't want to query SQLite every time we need some record. We want to avoid to query the database as most as we can, so we decided to keep certain…
Christian
  • 7,062
  • 9
  • 53
  • 79
31
votes
4 answers

How to delete items with same prefix key in memcached?

For example, I have some cached items with same prefix, such as 'app_111111', 'app_222222', 'app_333333', ... Can I remove such 'app_xxxxxx' items by any memcached commands?
northtree
  • 8,569
  • 11
  • 61
  • 80
30
votes
8 answers

Which is faster/better for caching, File System or Memcached?

I don't think it's clear to me yet, is it faster to read things from a file or from memcached? Why?
Lance
  • 75,200
  • 93
  • 289
  • 503
30
votes
2 answers

How do you choose between Memcached, Redis and Varnish?

I am really very confused about Memcached, Redis and Varnish. I know they are used for caching, but I don't know how much they help, and how you know which one to use. And lastly, I would like know what you would use for a site with user-uploaded…
Robin
  • 5,366
  • 17
  • 57
  • 87
29
votes
8 answers

How to call expire_fragment from Rails Observer/Model?

I've pretty much tried everything, but it seems impossible to use expire_fragment from models? I know you're not supposed to and it's non-MVC, but surely there much be some way to do it. I created a module in lib/cache_helper.rb with all my…
Marston A.
  • 1,153
  • 1
  • 12
  • 10
29
votes
4 answers

System.Web.Caching vs. Enterprise Library Caching Block

For a .NET component that will be used in both web applications and rich client applications, there seem to be two obvious options for caching: System.Web.Caching or the Ent. Lib. Caching Block. What do you use? Why? System.Web.Caching Is this…
ESV
  • 7,620
  • 4
  • 39
  • 29
29
votes
4 answers

Session VS File VS Memcache for a Cache in PHP?

I have a social network The users table is around 60,000 rows The friends table is around 1 million rows (used to determine who is your friend) I am wanting to do a friend feed, wall, whatever you like to call it, it will show things like user…
JasonDavis
  • 48,204
  • 100
  • 318
  • 537
28
votes
3 answers

Easy way for accessing memcached from node.js

I want to know if there is a good driver or native implementation to connect node.js directly to memcached.
Ezequiel
  • 514
  • 2
  • 7
  • 15
28
votes
6 answers

Memcache vs APC for a single server site data caching

I have a single server site thats pushing 200k unqiues per day, and the traffic doubles roughly every 40 days (for the last 5 months anyway). I pretty much only plan to cache the output of mysql_query functions for an hour or so. If cache is older…
user15063