Slide 1

Slide 1 text

By Thijs Feryn How to improve the performance of your website

Slide 2

Slide 2 text

Hi, I’m Thijs

Slide 3

Slide 3 text

I’m @ThijsFeryn on Twitter

Slide 4

Slide 4 text

I’m an Evangelist At

Slide 5

Slide 5 text

I’m a at board member

Slide 6

Slide 6 text

Web performance is an essential part of the user experience

Slide 7

Slide 7 text

Infrastructure

Slide 8

Slide 8 text

Code

Slide 9

Slide 9 text

Browser rendering

Slide 10

Slide 10 text

User location

Slide 11

Slide 11 text

Down Slowdown ~ downtime

Slide 12

Slide 12 text

Focus on the foundation first

Slide 13

Slide 13 text

Fast servers

Slide 14

Slide 14 text

Performance != Scalability

Slide 15

Slide 15 text

Performance: speed

Slide 16

Slide 16 text

Scalability: constant speed with increasing load

Slide 17

Slide 17 text

Add servers to maintain performance

Slide 18

Slide 18 text

Stability

Slide 19

Slide 19 text

Code efficiently

Slide 20

Slide 20 text

Identify slowest part

Slide 21

Slide 21 text

Optimize database

Slide 22

Slide 22 text

Optimize runtime

Slide 23

Slide 23 text

After a while you hit the limits

Slide 24

Slide 24 text

Don’t recompute if the data hasn’t changed

Slide 25

Slide 25 text

Cache

Slide 26

Slide 26 text

Memcached Redis APC

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Optimize database Optimize runtime A void A void

Slide 29

Slide 29 text

Don’t recompute if the data hasn’t changed

Slide 30

Slide 30 text

Varnish

Slide 31

Slide 31 text

Normally User Server

Slide 32

Slide 32 text

With Varnish User Varnish Server

Slide 33

Slide 33 text

Caching in your architecture

Slide 34

Slide 34 text

Respect HTTP

Slide 35

Slide 35 text

Cache-control: public, max- age=3600, s-maxage=7200 Cache-control: no-cache, no- store VS

Slide 36

Slide 36 text

Cookies?

Slide 37

Slide 37 text

Edge Side Includes

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Don’t cache header

Slide 40

Slide 40 text

Cache footer until 31/12/2015 23:59:59

Slide 41

Slide 41 text

Cache for a day

Slide 42

Slide 42 text

Cache for an hour

Slide 43

Slide 43 text

The Demo
{% block content %}{% endblock %}
ESI tags

Slide 44

Slide 44 text

Hit rate

Slide 45

Slide 45 text

Browser rendering

Slide 46

Slide 46 text

✓Concurrency limitations ✓Slowband, bad mobile connection ✓First byte time ✓Rendering time ✓Limit resource size ✓Limit resource amount ✓Re-use TCP connections

Slide 47

Slide 47 text

Compress images, JS & CSS

Slide 48

Slide 48 text

Combine multiple JS & CSS into one file

Slide 49

Slide 49 text

Right image size for the right device

Slide 50

Slide 50 text

Non- blocking Javascript

Slide 51

Slide 51 text

Google PageSpeed Insights & Web Page Performance Test

Slide 52

Slide 52 text

User location

Slide 53

Slide 53 text

Caching in the edge

Slide 54

Slide 54 text

Content Delivery Network

Slide 55

Slide 55 text

Faster responses per request

Slide 56

Slide 56 text

Don’t saturate your own network

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content