Better perfomance for BuddyPress TechzAround

Better perfomance for BuddyPress TechzAround
Like Tweet Pin it Share Share Email

# ———————————————————————-

# Expires headers (for better cache control)

# ———————————————————————-

# These are pretty far-future expires headers.

# They assume you control versioning with filename-based cache busting

# Additionally, consider that outdated proxies may miscache



# If you don’t use filenames to version, lower the CSS and JS to something like

# “access plus 1 week”.

<IfModule mod_expires.c>

ExpiresActive on


# Perhaps better to whitelist expires rules? Perhaps.

ExpiresDefault “access plus 1 month”


# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)

ExpiresByType text/cachemanifest “access plus 0 seconds”


# Your document html

<FilesMatch .(html|xhtml|xml|shtml|phtml|php|txt)$>

ExpiresDefault “access plus 0 seconds”


ExpiresByType text/html “access plus 0 seconds”


# Data

ExpiresByType text/xml “access plus 0 seconds”

ExpiresByType application/xml “access plus 0 seconds”

ExpiresByType application/json “access plus 0 seconds”


# Feed

ExpiresByType application/rss+xml “access plus 1 hour”

ExpiresByType application/atom+xml “access plus 1 hour”


# Favicon (cannot be renamed)

<FilesMatch .(ico)$>

ExpiresDefault “access plus 1 week”


ExpiresByType image/xicon “access plus 1 week”


# Media: images, video, audio

<FilesMatch .(gif|png|jpg|jpeg|ogg|mp4|mkv|flv|swf|wmv|asf|asx|wma|wax|wmx|wm)$>

ExpiresDefault “access plus 1 year”


ExpiresByType image/gif “access plus 1 month”

ExpiresByType image/png “access plus 1 month”

ExpiresByType image/jpeg “access plus 1 month”

ExpiresByType video/ogg “access plus 1 month”

ExpiresByType audio/ogg “access plus 1 month”

ExpiresByType video/mp4 “access plus 1 month”

ExpiresByType video/webm “access plus 1 month”


# HTC files (css3pie)

ExpiresByType text/xcomponent “access plus 1 month”


# Webfonts

<FilesMatch .(eot|ttf|otf|svg|woff)$>

ExpiresDefault “access plus 1 year”


ExpiresByType application/xfontttf “access plus 1 month”

ExpiresByType font/opentype “access plus 1 month”

ExpiresByType application/xfontwoff “access plus 1 month”

ExpiresByType image/svg+xml “access plus 1 month”

ExpiresByType application/vnd.msfontobject “access plus 1 month”


# CSS and JavaScript

<FilesMatch .(css|js)$>

ExpiresDefault “access plus 1 year”


ExpiresByType text/css “access plus 1 year”

ExpiresByType application/javascript “access plus 1 year”


# Static assets

<FilesMatch .(swf|pdf|doc|rtf|xls|ppt)$>

ExpiresDefault “access plus 1 year”


ExpiresByType application/xshockwaveflash “access plus 1 year”

ExpiresByType application/pdf “access plus 1 year”

ExpiresByType application/msword “access plus 1 year”

ExpiresByType application/rtf “access plus 1 year”

ExpiresByType application/vnd.msexcel “access plus 1 year”

ExpiresByType application/vnd.mspowerpoint “access plus 1 year”


<IfModule mod_deflate.c>

# Compress HTML, CSS, JavaScript, Text, XML and fonts

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/vnd.msfontobject

AddOutputFilterByType DEFLATE application/xfont

AddOutputFilterByType DEFLATE application/xfontopentype

AddOutputFilterByType DEFLATE application/xfontotf

AddOutputFilterByType DEFLATE application/xfonttruetype

AddOutputFilterByType DEFLATE application/xfontttf

AddOutputFilterByType DEFLATE application/xjavascript

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE font/opentype

AddOutputFilterByType DEFLATE font/otf

AddOutputFilterByType DEFLATE font/ttf

AddOutputFilterByType DEFLATE image/svg+xml

AddOutputFilterByType DEFLATE image/xicon

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/javascript

AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/xml

# Remove browser bugs (only needed for really old browsers)

BrowserMatch ^Mozilla/4 gziponlytext/html

BrowserMatch ^Mozilla/4.0[678] nogzip

BrowserMatch bMSIE !nogzip !gziponlytext/html

Header append Vary UserAgent


Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *