make your typo3 web sites fly

56
Make Your Web Sites Fly Jochen Weiland Freitag, 15. Juni 12

Upload: jweiland

Post on 08-May-2015

2.269 views

Category:

Technology


0 download

DESCRIPTION

This presentation shows a number of best practice tips to increase the performance of a TYPO3 website. The TYPO3 Governmentpackage 4.7.1 is used as an example.

TRANSCRIPT

Page 1: Make Your TYPO3 Web Sites Fly

Make Your Web Sites FlyJochen Weiland

Freitag, 15. Juni 12

Page 2: Make Your TYPO3 Web Sites Fly

Jochen Weiland

• TYPO3 since 2002

• Member Security Team

• Member BCC

• jweiland.net

Freitag, 15. Juni 12

Page 3: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 4: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 5: Make Your TYPO3 Web Sites Fly

Why Speed Matters

• User experience

• Increased use of mobile platforms

• Fast sites sell better

• Fast sites rank better

Freitag, 15. Juni 12

Page 6: Make Your TYPO3 Web Sites Fly

Google Webmaster ToolsLabs - Site Performance

Freitag, 15. Juni 12

Page 7: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 8: Make Your TYPO3 Web Sites Fly

What do do?

• Analyze!

• Optimize!

• Test!

Freitag, 15. Juni 12

Page 9: Make Your TYPO3 Web Sites Fly

Example

Freitag, 15. Juni 12

Page 10: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 11: Make Your TYPO3 Web Sites Fly

Analyze!

• Firebug

• Chrome Developer Tools

• YSlow!

• Google Page Speed

Freitag, 15. Juni 12

Page 12: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 13: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 14: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 15: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 16: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 17: Make Your TYPO3 Web Sites Fly

Request/Response Headers

Freitag, 15. Juni 12

Page 18: Make Your TYPO3 Web Sites Fly

YSlow! - Grade

Freitag, 15. Juni 12

Page 19: Make Your TYPO3 Web Sites Fly

YSlow! - Components

Freitag, 15. Juni 12

Page 20: Make Your TYPO3 Web Sites Fly

YSlow! Components Detail

Freitag, 15. Juni 12

Page 21: Make Your TYPO3 Web Sites Fly

YSlow! - Statistics

Freitag, 15. Juni 12

Page 22: Make Your TYPO3 Web Sites Fly

Chrome Developer Tools

Freitag, 15. Juni 12

Page 23: Make Your TYPO3 Web Sites Fly

Let's Start Optimizing!

Freitag, 15. Juni 12

Page 24: Make Your TYPO3 Web Sites Fly

1. Compress with gzip

Freitag, 15. Juni 12

Page 25: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 26: Make Your TYPO3 Web Sites Fly

Enable in Install Tool

Freitag, 15. Juni 12

Page 27: Make Your TYPO3 Web Sites Fly

.htaccess File

<FilesMatch "\.js\.gzip$"> AddType "text/javascript" .gzip</FilesMatch><FilesMatch "\.css\.gzip$"> AddType "text/css" .gzip</FilesMatch>AddEncoding gzip .gzip

Freitag, 15. Juni 12

Page 28: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 29: Make Your TYPO3 Web Sites Fly

That saved 5%...so what?

Freitag, 15. Juni 12

Page 30: Make Your TYPO3 Web Sites Fly

Let's add some TypoScript

config.compressJs = 1config.compressCss = 1

*requires TYPO3 4.6 or higher

Freitag, 15. Juni 12

Page 31: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 32: Make Your TYPO3 Web Sites Fly

57% less

Freitag, 15. Juni 12

Page 33: Make Your TYPO3 Web Sites Fly

2. Use cookieless domains

Freitag, 15. Juni 12

Page 34: Make Your TYPO3 Web Sites Fly

Cookie is sent with every request

Freitag, 15. Juni 12

Page 35: Make Your TYPO3 Web Sites Fly

Ext: ja_replacerconfig.tx_ja_replacer.search {  10="/typo3temp/  11="typo3temp/  12="/fileadmin/  13="fileadmin/  14="/typo3conf/  15="typo3conf/}

tx_ja_replacer.unsecure = COAtx_ja_replacer.unsecure {  10="http://static.typo3-workshop.net/typo3temp/  11="http://static.typo3-workshop.net/typo3temp/  12="http://static.typo3-workshop.net/fileadmin/  13="http://static.typo3-workshop.net/fileadmin/  14="http://static.typo3-workshop.net/typo3conf/  15="http://static.typo3-workshop.net/typo3conf/}

config.tx_ja_replacer.replace < tx_ja_replacer.unsecure

Freitag, 15. Juni 12

Page 36: Make Your TYPO3 Web Sites Fly

No cookies anymore

Freitag, 15. Juni 12

Page 37: Make Your TYPO3 Web Sites Fly

3. Use Browser Cache

Freitag, 15. Juni 12

Page 38: Make Your TYPO3 Web Sites Fly

.htaccess:

ExpiresActive OnExpiresDefault "access plus 31 days"

ExpiresByType application/javascript A900ExpiresByType application/x-javascript A900ExpiresByType text/javascript A900ExpiresByType text/html A1800ExpiresByType text/xml A90ExpiresByType text/css A900ExpiresByType text/plain A90ExpiresByType image/gif A604800ExpiresByType image/jpg A604800ExpiresByType image/jpeg A604800ExpiresByType image/png A604800ExpiresByType image/bmp A604800ExpiresByType application/x-shockwave-flash A604800

Freitag, 15. Juni 12

Page 39: Make Your TYPO3 Web Sites Fly

config.sendCacheHeaders = 1

Freitag, 15. Juni 12

Page 40: Make Your TYPO3 Web Sites Fly

4. Use Sprites

Freitag, 15. Juni 12

Page 41: Make Your TYPO3 Web Sites Fly

sprites.pngOne Image File with 17 Symbols

article ul.csc-menu li { margin-left: 0.5em; padding-left: 1.75em; margin-bottom:0.5em; font-size: 1em; line-height: 1.25em;

before:

background: url(../img/icon-arrow-down.png) 0 0.3em no-repeat;

after:

background: url(../img/sprites.png) -20px -95px no-repeat;}

Freitag, 15. Juni 12

Page 42: Make Your TYPO3 Web Sites Fly

From 19 to 12 image request

Freitag, 15. Juni 12

Page 43: Make Your TYPO3 Web Sites Fly

5. Use a CDN

Freitag, 15. Juni 12

Page 44: Make Your TYPO3 Web Sites Fly

Using a CDN

• Webserver located in Munich, Germany

• Static files stored on Amazon S3 in Irelandat http://jweilandawstest.s3-website-eu-west-1.amazonaws.com/

• Amazon CloudFront for worldwide distribution

Freitag, 15. Juni 12

Page 45: Make Your TYPO3 Web Sites Fly

config.tx_ja_replacer.search { 10="/typo3temp/ 11="typo3temp/ 12="/fileadmin/default/templates/ 13="fileadmin/default/templates/ 14="/typo3conf/ 15="typo3conf/ 16="/uploads/ 17="uploads/}

tx_ja_replacer.http = COAtx_ja_replacer.http { 10="http://static.typo3-workshop.net/typo3temp/ 11="http://static.typo3-workshop.net/typo3temp/ 12="http://cdn.typo3-workshop.net/cdn/fileadmin/default/templates/ 13="http://cdn.typo3-workshop.net/cdn/fileadmin/default/templates/ 14="http://static.typo3-workshop.net/typo3conf/ 15="http://static.typo3-workshop.net/typo3conf/ 16="http://cdn.typo3-workshop.net/cdn/uploads/ 17="http://cdn.typo3-workshop.net/cdn/uploads/}

config.tx_ja_replacer.replace < tx_ja_replacer.http

Freitag, 15. Juni 12

Page 46: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 47: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 48: Make Your TYPO3 Web Sites Fly

Using a CDN

Freitag, 15. Juni 12

Page 49: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 50: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 51: Make Your TYPO3 Web Sites Fly

Before:

After:

Freitag, 15. Juni 12

Page 52: Make Your TYPO3 Web Sites Fly

Before:

After:

Freitag, 15. Juni 12

Page 53: Make Your TYPO3 Web Sites Fly

Before:

After:

Freitag, 15. Juni 12

Page 54: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12

Page 55: Make Your TYPO3 Web Sites Fly

Chrome Timeline

Freitag, 15. Juni 12

Page 56: Make Your TYPO3 Web Sites Fly

Freitag, 15. Juni 12