Page 1 of 1

How To Install Varnish Cache

Posted: Tue Jun 02, 2015 9:27 am
by n0rton
Hi,

I installed varnish cache, memcached, xcached and nice work website.


Ubuntu:

Code: Select all

  
    apt-get install apt-transport-https
    curl https://repo.varnish-cache.org/GPG-key.txt | apt-key add -
    echo "deb https://repo.varnish-cache.org/ubuntu/ precise varnish-4.0" >> /etc/apt/sources.list.d/varnish-cache.list
    apt-get update
    apt-get install varnish
Debian:
apt-get install apt-transport-https
curl https://repo.varnish-cache.org/GPG-key.txt | apt-key add -
echo "deb https://repo.varnish-cache.org/debian/ wheezy varnish-4.0" >> /etc/apt/sources.list.d/varnish-cache.list
apt-get update
apt-get install varnish
Red Hat (Linux - Centos):

Code: Select all

    Version 4.0

    rpm --nosignature -i https://repo.varnish-cache.org/redhat/varnish-4.0.el6.rpm
    yum install varnish

service varnish restart

And for see if work:

varnishstat (comand)


Uptime mgt: 0+00:11:00 Hitrate n: 10 100 573
Uptime child: 0+00:11:00 avg(n): 0.0000 0.0000 0.0000

NAME CURRENT CHANGE AVERAGE AVG_10
MAIN.uptime 660 1.00 1.00 1.00
MAIN.pools 2 0.00 . 2.00
MAIN.threads 100 0.00 . 100.00
MAIN.threads_created 100 0.00 . 0.00
MAIN.n_backend 1 0.00 . 1.00
MAIN.n_vcl 1 0.00 . 0.00
MAIN.bans 1 0.00 . 1.00
MGT.uptime 660 1.00 1.00 1.00
SMA.s0.g_space 268435456 0.00 . 268435456.00




Test in gtmetrix for speed website:

Page Speed Grade:
(98%)

YSlow Grade:
(96%)

Page load time: 0.94s
Total page size: 72.8KB
Total number of requests: 5

Re: How To Install Varnish Cache

Posted: Tue Jun 02, 2015 2:20 pm
by skurudo
It was tested on static site?
varnish + nginx + apache?

Re: How To Install Varnish Cache

Posted: Wed Jun 03, 2015 6:33 am
by mephivio
hi
that's not enougth : you have to setup a vcl file depending on the spec of your platform wordpress, joomla, prestashop etc... or you will cache anything including user pages, carts etc....

cheers

JP

Re: How To Install Varnish Cache

Posted: Wed Jun 03, 2015 6:57 am
by skurudo
mephivio wrote: that's not enougth : you have to setup a vcl file depending on the spec of your platform wordpress, joomla, prestashop etc... or you will cache anything including user pages, carts etc....
Yep, this is important notice.
But for popular platforms exist ready examples ;-)