[CB16] 80ๆ้ใงWebใไธๅจ:ใฏใญใ ใใฆใ ใชใผใใกใผใทใงใณใซใใในใฑใผใฉใใซใชใใฃใณใฌใผใใชใณใ by Isaac DawsonCODE BLUE
9. โYESโฆ THIS SEEMS TO BE AN ACUTE CASE OF โจ
SLUGGISHNESS IN YOUR WORDPRESSโ
10. ANALYZE THE SITE
MY ANALYSIS TOOLS OF CHOICE
โธ Firebug in Mozilla Firefox (donโt use it in Chrome)
โธ gtmetrix.com (combines Google Pagespeed, Yahoo YSlow,
โฆ)
11.
12.
13.
14. ANALYZE THE SITE
IDEAL VALUES
โธ 30 to 50 elements -> concurrent browser connections
โธ 0 to 1.5 MB in size
โธ Less is more
15.
16.
17.
18.
19. ANALYZE THE SITE
WAYS TO IMPROVE LOADING SPEED
โธ Domain sharding
โธ CSS-sprites (http://css-tricks.com/css-sprites/)
21. OPTIMIZE WORDPRESS
SLOW INITIAL GET?
โธ Usually points towards too many queries
โธ Fix: limit or reduce the number of queries
22. OPTIMIZE WORDPRESS
SLOW INITIAL GET?
โธ Usually points towards too many queries
โธ Fix: limit or reduce the number of queries
Reduce your plugins to the bare minimum!
28. OPTIMIZE WORDPRESS
MY PLUGIN OF CHOICE
โธ Proof by Mattias Geniar:โจ
https://ma.ttias.be/benchmarking-the-performance-of-
wordfence-a-wordpress-plugin/
30. SERVER SIDE TWEAKS
GZIP
โธ Compresses the data sent from server to browser
โธ add to your .htaccess:โจ
โจ
AddOutputFilterByType DEFLATE text/plainโจ
AddOutputFilterByType DEFLATE text/htmlโจ
AddOutputFilterByType DEFLATE text/xmlโจ
AddOutputFilterByType DEFLATE text/cssโจ
AddOutputFilterByType DEFLATE application/xmlโจ
AddOutputFilterByType DEFLATE application/xhtml+xmlโจ
AddOutputFilterByType DEFLATE application/rss+xmlโจ
AddOutputFilterByType DEFLATE application/javascriptโจ
AddOutputFilterByType DEFLATE application/x-javascript
31. SERVER SIDE TWEAKS
DISABLE ENTITY TAGS
โธ Mechanism to verify if browsercache items correspond to
current server version
โธ disable by adding this to .htaccess:โจ
โจ
Header unset ETagโจ
FileETag None
32. SERVER SIDE TWEAKS
MOD_EXPIRES
โธ Allows us to take control of the browsercache without a caching plugin
โธ add to your .htaccess:โจ
โจ
# BEGIN Expire headersโจ
<IfModule mod_expires.c>โจ
ExpiresActive Onโจ
ExpiresDefault "access plus 5 seconds"โจ
ExpiresByType image/x-icon "access plus 2500000 seconds"โจ
ExpiresByType image/jpeg "access plus 2500000 seconds"โจ
ExpiresByType image/png "access plus 2500000 seconds"โจ
ExpiresByType image/gif "access plus 2500000 seconds"โจ
ExpiresByType application/x-shockwave-๏ฌash "access plus 2500000 seconds"โจ
ExpiresByType text/css "access plus 600000 seconds"โจ
ExpiresByType text/javascript "access plus 200000 seconds"โจ
ExpiresByType application/javascript "access plus 200000 seconds"โจ
ExpiresByType application/x-javascript "access plus 200000 seconds"โจ
ExpiresByType text/html "access plus 600 seconds"โจ
ExpiresByType application/xhtml+xml "access plus 600 seconds"โจ
</IfModule>
33. SERVER SIDE TWEAKS
MOD_EXPIRES
โธ add to your .htaccess (second part):โจ
โจ
# BEGIN Cache-Control Headersโจ
<IfModule mod_headers.c>โจ
<๏ฌlesMatch ".(ico|jpe?g|png|gif|swf)$">โจ
Header set Cache-Control "public"โจ
</๏ฌlesMatch>โจ
<๏ฌlesMatch ".(css)$">โจ
Header set Cache-Control "public"โจ
</๏ฌlesMatch>โจ
<๏ฌlesMatch ".(js)$">โจ
Header set Cache-Control "private"โจ
</๏ฌlesMatch>โจ
<๏ฌlesMatch ".(x?html?|php)$">โจ
Header set Cache-Control "private, must-revalidate"โจ
</๏ฌlesMatch>โจ
</IfModule>โจ
# END Cache-Control Headers
44. CACHING STRATEGIES
WHY I PREFER REDIS
โธ Values up to 512MB in size (memcached limited to 1MB
per key)
โธ Supports much more programming languages