SocialEngine 4: Speed Up SE4 Via .HTACCESS

To Help SE Preform better you can add this coding to your .HTACCESS file.

# 1 YEAR
<filesMatch "\.(ico|pdf|flv)$">
Header set Cache-Control "max-age=29030400, public"
</filesMatch>
# 1 WEEK
<filesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
# 2 DAYS
<filesMatch "\.(xml|txt|css|js)$">
Header set Cache-Control "max-age=172800, proxy-revalidate"
</filesMatch>
# 1 MIN
<filesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=60, private, proxy-revalidate"
</filesMatch>

<ifModule mod_expires.c>
# any Expires Directives go here
</ifModule>

<ifModule mod_headers.c>
# any Header directives go here
</ifModule>

<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault A300
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A3600
ExpiresByType text/css A3600
ExpiresByType image/gif A604800
ExpiresByType image/png A604800
ExpiresByType image/jpeg A604800
ExpiresByType text/plain A300
ExpiresByType application/x-shockwave-flash A604800
ExpiresByType video/x-flv A604800
ExpiresByType application/pdf A604800
ExpiresByType text/html A300
</ifModule>

<ifModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/x-icon A2592000
ExpiresByType application/pdf A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/plain A2592000

# Expires after 4.8 hours
ExpiresByType text/css A17200
</ifModule>

<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault A86400
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType image/gif A604800
ExpiresByType image/png A604800
ExpiresByType image/jpeg A604800
ExpiresByType text/plain A604800
ExpiresByType application/x-shockwave-flash A604800
ExpiresByType video/x-flv A604800
ExpiresByType application/pdf A604800
ExpiresByType text/html A900
</ifModule>

<ifModule mod_headers.c>
# YEAR
<filesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$">
  Header set Cache-Control "max-age=29030400"
</filesMatch>
# WEEK
<filesMatch "\.(js|css|swf)$">
  Header set Cache-Control "max-age=604800"
</filesMatch>
# 45 MIN
<filesMatch "\.(html|htm|txt)$">
  Header set Cache-Control "max-age=2700"
</filesMatch>
</ifModule>

I hope this helps a lot of people who needs a slightly faster site.

Looking for quality SocialEngine Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , | Posted under SocialEngine | RSS 2.0

Author Spotlight

Andrew Cross

Andrew Cross

Hi, I'm Andrew. A am a 25, ICT Administrator which offers support to company's around the South Wales Area. I have created a few social sites for myself and other company's. So far 2 out of 3 have been successful using the powerful SocialEngine Script. I continue to try and help the community of SocialEngine by giving Support and Technical Help where possible.

One Comment on SocialEngine 4: Speed Up SE4 Via .HTACCESS

  1. Ty says:

    Thank you this really helped me, works like a charm.

Leave a Reply

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


9 × = 18

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>