Overview
1. Measure your performance2. Tweak your cache TTLs3. Cache dynamic objects4. Cache whole pages5. Inspect origin hits6. Use proper HTTP headers7. Use multiple CDNs8. Review CDN documentation9. Engage your vendor
Response Headers
Cache-control: max-age=3600
Last-Modified: Mon, 16 Mar …
ETag: “82c7-378-8e2a”
http://www.askapache.com/htaccess/apache-speed-etags.html
Revalidation Requests
GET /images/generated.css HTTP/1.1
Host: origin.example.com
If-Modified-Since: Mon, 16 Mar …
If-None-Match: ”82c7-378-8e2a”
HTTP/1.1 200 OK
Content-Length: 35043
... or ...
HTTP/1.1 304 Not Modified
$$$
$
Review Origin Logs
Requests URL Size
28 /images/logo.gif 2 KB
17 /images/nav_tabs.png 5 KB
4,613 /images/annual_report.ppt 16 MB
31 /images/flames.gif 13 KB
Avoid Double Paying
16 MB x 4,600 @ 0.35/GB ≈ $25 (CDN)
16 MB x 23 @ 0.50/GB ≈ $0.18 (origin)
$25- ish
Cache HTML PagesTrack short history of
user interactions
Fresh data only
where needed
Ajax, Cookies,
JavaScript
Cache HTML PagesUse tracking pixels for
page views
Real time data with Ajax,
or fake it
Ajax, Cookies,
JavaScript
CDNs Fail
Amazon CloudFront: $0.17/GB*
Rackspace Cloud Files: $0.22/GB
JetS3t, Cyberduck, Transit, S3 Browser, S3Fox Plug-in, s3sync.rb, APIs, etc.
Top Related