5. @agatestudio@agatestudio@agatestudio
Why
• So, instead of web server doing the same process
and the same result, why not caching the result and
pass to user.
• However, remember that:
– Your data might be obsolete/incorrect
– So, you must configure varnish correctly.
• Determine which one that can be processed by varnish
• Or the one that must be checked by Web Server
8. @agatestudio@agatestudio@agatestudio
What to do
Pass: Send it to apache
Lookup: try to get it from cache
sub vcl_recv {
# Set the URI of your system directory
if (req.url ~ '^/admin/' ||
req.url ~ 'ACT=' ||
req.request == 'POST')
{
return (pass);
}
#unset user cookie from being saved to
cache
unset req.http.Cookie;
return(lookup);
}
10. @agatestudio@agatestudio@agatestudio
Varnish vs NginX
• Varnish cannot do https request :D. Meanwhile nginx
can do that.
• Others said that better we use nginx only :D
– Config varnish, nginx, apache is not worth of time
– Nginx + PHP + DB + APC/Memcache is more than enough
– So, it depends on App in the Server