Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>From the rails caching guide regarding <a href="http://guides.rubyonrails.org/caching_with_rails.html#activesupport-cache-memorystore" rel="noreferrer"><code>memory_store</code></a>: </p> <blockquote> <p>This cache store keeps entries in memory in the same Ruby process.</p> </blockquote> <p>You'd expect that to be pretty damn quick for some benchmarks. It doesn't have to put any effort into reading to or writing from any other kind of storage. The cached stuff is just <em>there</em> when it needs it.</p> <p>However, you can't store too much information like that before it becomes unwieldy. The processes for your server will grow and your cache will get rid of the oldest cached information pretty quickly (the default size of this cache is 32mb).</p> <p>Also, with multiple processes running, as you'd have for a production server, you would be duplicating cached information across each process. For example, if your home page is cached you'd need to cache it on each of the processes that run on the server.</p> <p>You're also going to have problems manually expiring things from a cache that is within the server processes because you need to either communicate with all the running processes to expire cached information or get them to check if the information is stale before accessing it.</p> <p>By using something like memcached or redis you can have all of your server processes accessing the same cache and you can have a much bigger cache meaning that cached information becomes stale a lot less frequently. You can write once to the cache and all server processes benefit and you can clear once and all processes know it is cleared.</p> <p>As you've identified, the trade-off is the performance of writing to and reading from the cache but on a system of any kind of size that performance trade-off isn't worth it compared to having a more sophisticated caching store.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload