NZIFF and Fastly

34
Making NZIFF faster and bigger with Fastly @avon

description

Using custom VCL to move a website with user login and cookies to a CDN. With Privacy Parrot, Crypto Cat and Debug Chameleon.

Transcript of NZIFF and Fastly

Page 1: NZIFF and Fastly

Making NZIFF faster and bigger with Fastly

@avon

Page 2: NZIFF and Fastly

Varnish & Fastly

• Fastly let you upload VCL

• POPs in New Zealand!

• (Instant purge - we didn’t use it but it’s a game changer)

• Older version of Varnish (~2.1)

Page 3: NZIFF and Fastly

Varnish state machine

Page 4: NZIFF and Fastly

vcl_recv & vcl_hash

• vcl_recv processes a request; decides what to do:lookup or pass

• vcl_hash makes a cache key for looking up request and caching responses

Page 5: NZIFF and Fastly
Page 6: NZIFF and Fastly

vcl_recv

Page 7: NZIFF and Fastly

vcl_recv

Page 8: NZIFF and Fastly

Cookies

• User session stuff

• nziff.region

Page 9: NZIFF and Fastly

privacy privacy

Page 10: NZIFF and Fastly

vcl_recv

Page 11: NZIFF and Fastly
Page 12: NZIFF and Fastly
Page 13: NZIFF and Fastly

AJAX AJAX

Page 14: NZIFF and Fastly
Page 15: NZIFF and Fastly

vcl_recv

Page 16: NZIFF and Fastly

Cookies

• User session stuff

• nziff.region

Page 17: NZIFF and Fastly
Page 18: NZIFF and Fastly

vcl_recv

Page 19: NZIFF and Fastly

vcl_recv

Page 20: NZIFF and Fastly

vcl_hash

Page 21: NZIFF and Fastly

privacy privacy

Page 22: NZIFF and Fastly

Privacy & Personalisation

• Cookies

• Accept-Language

• User-Agent

• Custom headers

Page 23: NZIFF and Fastly

vcl_recv

Page 24: NZIFF and Fastly

vcl_recv

Page 25: NZIFF and Fastly

Varnish state machine

Page 26: NZIFF and Fastly

vcl_fetch

• vcl_fetch processes the response from the backend

• vcl_fetch runs for pass and miss

Page 27: NZIFF and Fastly
Page 28: NZIFF and Fastly

vcl_fetch

Page 29: NZIFF and Fastly

vcl_fetch

Page 30: NZIFF and Fastly

Varnish state machine

Page 31: NZIFF and Fastly

vcl_deliver

Page 32: NZIFF and Fastly

comment all the vcl

Page 33: NZIFF and Fastly

Stats

Page 34: NZIFF and Fastly