This page shows you how to use a C1 server to cache your Scaleway SIS objects with Varnish.
- You have an account and are logged into cloud.scaleway.com
- Your SSH key is configured
- You have an API Token
- You have a running server
- S3cmd is configured
In this guide, we will cache bootstrap. The procedure will also work for any other static website.
There are four steps to cache a static website with Scaleway SIS and Varnish
In the Control Panel, click “Storage” from the left side menu.
You land on the Storage page that lists your buckets. Click on the “Create Bucket” button to create the bucket that will store our objects. Then, input a name for your bucket and validate.
Now that your bucket is created, you need to upload your content inside. See how to configure S3cmd for Scaleway SIS to upload your files.
The s3cmd command above does the following:
We now have to configure Varnish to work with Scaleway SIS.
First, connect to your C1 server via ssh
Then you have to install Varnish on your server. On Debian-like distributions, execute an
apt-get update to update package lists and install Varnish with
apt-get install varnish
Once Varnish installed, you have to configure it to cache the static pages stored into Scaleway SIS.
Open the /etc/varnish/default.vcl file, this file contains the caching policies.
For instance, to cache the files stored into the
bootstrap bucket with Varnish the
default.vcl file looks like this:
Save the file and restart the Varnish daemon
service varnish restart.
By default, Varnish listens to the port 6081 and use 256m of memory to store your objects. Edit
/etc/default/varnish to change the defaults.
Open your browser and access to
http://server_ip:6081/index.html, your page should be displayed. You can disable the cache on any object by setting the
Cache-Control header to
For instance if you do not want to cache the
file.html you have to set the header as
Depending of the contents you want to serve, you might want to: