Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is squid good for REST architectures?

In this article, it is argued that Use Memcache if you frequently fetch random entities from a database, and Squid if you use a REST architecture. Please explain why (with regard to Squid).

like image 975
Jacques René Mesrine Avatar asked Nov 28 '09 12:11

Jacques René Mesrine


2 Answers

Memcache is a distributed object store - it's up to you to put objects in and out of this. It's a general purpose cache for any usage.

Squid is a proxy server and a web cache. If everything is through a URL (e.g. REST) then Squid will do the job for free.

So in summary, memcache is general purpose, Squid is for caching the results of a URL.

like image 161
Jeff Foster Avatar answered Nov 08 '22 20:11

Jeff Foster


REST is all about http and resources.

squid can be used as a reverse proxy, so it will take load from the webserver. the server side can set some expires http header to indicate the timewindow for caching.

this said, the caching is done mainly over standard http headers, therefore its closer to rest styles architecture than caching db queries.

like image 39
miku Avatar answered Nov 08 '22 21:11

miku