1. Varnish cache server – tốt hay xấu:
Varnish cache servers are considered good to speed up websites. It works quite well at the basis server infrastructure, although it can prove to be bad for developers who are working on CSS codes. In a nutshell, most of the customers love the speed performance offered by servers running on varnish cache system, but it has its own limitations.
Limits – giới hạn khi sử dụng:
Varnish cache servers are limited at two factors.
- Varnish cache servers do not allow tweaking .htaccess file.
- Varnish cache servers do not allow the execution of cache plugins.
* Kiểm tra xem Varnish cache có hoạt động tốt với Woocommerce không? Có làm drop cookie => empty cart không?
2. Is Varnish cache working on this site – Free check:
Ví dụ về Varnish cache chạy với SSL:
Tham khảo hướng dẫn install của Linode: https://www.linode.com/docs/websites/varnish/use-varnish-and-nginx-to-serve-wordpress-over-ssl-and-http-on-debian-8/
Tham khảo cách lấy IP thật của user:
To get the Real IP of your WooCommerce user comments and emails from Varnish, use the Real IP feature of nginx
Những vấn đề cần đoc thêm:
+ Cài Varnish trên 1 server Nginx được không? (mô hình SSL: nginx => varnish => backend nginx)
+ Ram tối thiểu allocated cho Varnish cache để Varnish cache hoạt động hiệu quả
Tham khảo configuration – Nginx.conf & varnish conf: https://www.digitalocean.com/community/questions/nginx-ngx_pagespeed-and-varnish-but-server-responded-slow-how-to-fix
Varnish cache vs memcached
An HTTP proxy server and
memcached are different technologies that solve different problems and apply at different layers of your software stack. Both can be useful.
An HTTP proxy server sitting in front of your application can respond to requests from its cache, saving your application from having to handle some of the request load. This only works if your application outputs content that is cacheable and if end users request the content more than once. In order for the content to be cacheable, your application needs to set the appropriate HTTP headers to let proxy servers (and browsers) know what is cacheable and for how long.
In the case of requests that make it all the way to your application (they miss the HTTP proxy cache or there is no HTTP proxy), your application has to compute the content it needs to send back. If this computation is expensive but parts of the data can be cached from previous requests,
memcached is a good way for your application to stash away the results of [parts of] those computations so they can be reused later. Your application needs to be written specifically to do this, and to connect to
memcached instances to get and set this data.