Download - Performance, an overview
![Page 1: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/1.jpg)
PERFORMANCEAN OVERVIEW
HAVE YOUR CACHE AND EAT IT TOOCreated by Tony Aslett / @taslett
![Page 2: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/2.jpg)
PERFORMANCETime taken to render in a browser/device.
Neo, follow the white rabbit.
![Page 3: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/3.jpg)
AFFECTING PERFORMANCENetwork speedServer responseFile sizeNumber of requests
![Page 4: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/4.jpg)
BROWSER REQUEST1. User: requests a page from the browser2. Network: DNS finds the server and sends request3. Server: responds to the page request, generates page.4. Network: the page is returned.5. Browser: Renders the page, pulls the files (requests) together
![Page 5: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/5.jpg)
HTTP HEADERSHeaders are sent to and from the server with the request.
Tell points along the path of the request if cache can be used.
![Page 6: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/6.jpg)
REQUEST HEADERSBrowser, user agentip addressCompression support, gzipCache-controlCookiesReferer
![Page 7: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/7.jpg)
RESPONSE HEADERSLast-modifiedExpiresCache-controlE-tag
![Page 8: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/8.jpg)
SAFE TO CACHEAnonymous trafficScripts and stylesheetsImages
![Page 9: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/9.jpg)
BE WARY OF CACHING:form, post datalogged in usersUser specific content/blocks etc.Dynamic contentHTTPS SSL
![Page 10: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/10.jpg)
GOOGLE HTTPS EVERYWHEREGoogle is encouraging the use of https by increasing ranking
HTTPS as a ranking signalhttp://youtu.be/cBhZ6S0PFCYpossible rewrite of caching rulesNo support for SSL in varnish
![Page 11: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/11.jpg)
CACHE LOCATIONSBrowserNetwork: proxyServer: database, memoryCode
![Page 12: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/12.jpg)
BROWSER CACHEFast, no downloadHeaders cache-control:max-age-?From the second resource loadUse CDN for re-useable external resources
![Page 13: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/13.jpg)
NETWORK CACHEProxyCDN: Content Delivery Network, cloudflareCloser to the browser/userOpera mobile turboCloud Browsers, Maxthon
![Page 14: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/14.jpg)
SERVERWatch CPU and Memory usage, new relicOpcode cache, APCMemcacheVarnishnginxSPDY
![Page 15: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/15.jpg)
APCPHP is converted to opcode (computer readable) on the flyAPC stores files as opcode in memory for reuseSignificant improvementPHP 5.4? has it's own opcode cache
![Page 16: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/16.jpg)
MEMCACHEKey value stored in memoryWorks well with specific table dataReplaces cache tables
![Page 17: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/17.jpg)
VARNISHSits before the web serverVery fast 300X
![Page 18: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/18.jpg)
CODE DRUPALTrack slow queriesAvoid excessive loopsUse drupal_staticCache Views, entities, Blocks blockcache_alterStatic files and content, Boost
![Page 19: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/19.jpg)
FILESLimit number and sizeCompressAllow cachingDon't delay rendering
![Page 20: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/20.jpg)
PERFORMANCE TOOLSFind your bottle neck and test your solution.
![Page 21: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/21.jpg)
BROWSER TOOLSinbuilt developer tools.extensions e.g. pagespeed, yslow
Network requests, file sizes, headers...
![Page 22: Performance, an overview](https://reader033.vdocuments.site/reader033/viewer/2022051209/54899b97b4795984178b55a9/html5/thumbnails/22.jpg)
TESTING/REPORTING TOOLSab Apache benchJMeterWebmaster toolsWhat do you use?