# SlowFS Cache or Proxy\_Cache for GridFS

**URL:** <https://www.ruby-forum.com/t/slowfs-cache-or-proxy-cache-for-gridfs/203500>\
**Category:** NGINX\
**Created:** [February 21, 2011, 5:59pm UTC](https://www.ruby-forum.com/t/slowfs-cache-or-proxy-cache-for-gridfs/203500 "2011-02-21T17:59:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 21, 2011, 5:59pm UTC](https://www.ruby-forum.com/t/slowfs-cache-or-proxy-cache-for-gridfs/203500/1 "2011-02-21T17:59:34Z")

</div>

Hello,

checking SlowFS looks like a good solution for caching Files/Images  
stored by GridFS (MongoDB). But my config saves no file in my  
“fastcache” dir:

location / {  
gridfs test field=filename type=string;  
slowfs\_cache fastcache;  
slowfs\_cache\_key $uri;  
slowfs\_cache\_valid 1d;  
}

Any ideas how to cache Files stored in GridFS? Perhaps Proxy\_Cache can  
Store the files localy? Any Ideas are welcome.

Thanks for your help.

## Elena

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir  
belohnen Sie mit bis zu 50,- Euro! [https://freundschaftswerbung.gmx.de](https://freundschaftswerbung.gmx.de)

---

<div class="post-metadata">

**Author:** ![Elena\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@Elena\_Z](https://www.ruby-forum.com/u/Elena_Z)\
**Post date:** [February 21, 2011, 6:03pm UTC](https://www.ruby-forum.com/t/slowfs-cache-or-proxy-cache-for-gridfs/203500/2 "2011-02-21T18:03:58Z")

</div>

On 2/21/11 11:56 AM, “Elena Z.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Any ideas how to cache Files stored in GridFS? Perhaps Proxy\_Cache can Store  
> the files localy? Any Ideas are welcome.

Neither will work. Slowfs actually uses file system calls for the  
“read”  
part of the cache. GridFS does not use the upstream, if it did then it’d  
be  
easy to hack a cache. You could use memcache and srcache.

–  
Brian A.

---

<div class="post-metadata">

**Author:** ![Elena\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@Elena\_Z](https://www.ruby-forum.com/u/Elena_Z)\
**Post date:** [February 21, 2011, 6:38pm UTC](https://www.ruby-forum.com/t/slowfs-cache-or-proxy-cache-for-gridfs/203500/3 "2011-02-21T18:38:26Z")

</div>

Hi,

On 21/02/2011 18:56, Elena Z. wrote:

> Any ideas how to cache Files stored in GridFS? Perhaps Proxy\_Cache can Store the  
> files localy? Any Ideas are welcome.  
> If you are at all concerned about performance, you might want to think  
> about an alternative to using the gridfs module for Nginx. AFAIK it  
> still uses the Mongo-provided C library, which is blocking, so you’ll  
> lose many of the benefits of Nginx’s performance.

Marcus.
