Speed Up SocialEngine 4 (SE4) Tutorial

Speed up SocialEngine 4 (SE4) is the first priority before making the site go for live. Not just because we get too much traffic but because we have to make the trust for our users and don’t let them wait too long just for the page load. And you know, even though the core functionality of SocialEngine (SE4) has already supported the caching and performance tools but it is not enough to make the site fly, we need to do somethings more to speed up socialengine 4 (SE4).

speed up social engine 4(se4)

Why we have to speed up socialengine 4 (se4)?

It doesn’t make sense to do anything if we don’t know why you have to do it. To know why Speed Up SocialEngine is so important for us, let ‘s go through these reasons:

  • SocialEngine 4 is a heavy platform what base on Zend Framework, if we don’t do the optimization it will work slow.
  • Users is not patient, they will leave the site right away if you take them more than 2 seconds for waiting a page load.
  • SEO reason: search engine always love the fast site. Your site will be indexed faster and high ranking. We have no doubt that the site speed is one of the most important things in Google Search Engine ranking.
  • The Trust: if you want to make your users trust your services. Let them trust your website with high performance and fast loading page first. No one trusting you if they don’t see your services or products with low quality. In this case, it ‘s your SocialEngine site.
  • Time to manage: how much time your SE site take you daily to manage everything? I am pretty sure you will save a lot of your daily time if you make it work faster.
  • Time to develop and maintain: the same things here with time for your developers. If you have to pay the development, you will save a lot of money from development works if you make the site fast in the beginning.

So I believe the above list is good enough for all of people to decide to speed up their socialengine site. If you think it still not enough, and you still want to keep the slow site then you can stop reading here, unless let ‘s keep continue reading, we will go to step by step to speed up socialengine 4 (SE4). I promise you, they are almost easy tasks from our SEZONE experts :).

1. Choose the right SocialEngine Hosting/Server for best server performance

The SocialEngine Hosting/Server is the most important to make your SE4 site work or not, fast or not. First of all, you have to own a server/hosting what is designed for SocialEngine 4. Because SE4 is heavy so that it require the server configuration strictly.

If your server configuration/installation skills is good enough, you can make a SocialEngine Server to handle your website. It required an experience SE4 expert, after that you have to take time to maintain server to make sure it work well. If you want this service,  you can Contact Us to do that for you with the affordable price.

The best way to solve SE4 Hosting/Server problem is the high quality hosting/server service. Our team always choose SiteGround SocialEngine Hosting package ($3.95/month). We got almost our customers hosting their SE site from this hosting package from 2012. The reason why we don’t use them from 2010 because they didn’t support supercacher in that time, but then their supercacher tools was born and make their hosting service become very fast. Other than that, they always have the SE expert team who always ready to help. It save us a lot of time to invest to our development.


2. Speed Up SocialEngine 4 Browser Cache with .htaccess

If you are using apache webserver (the most popular web server for PHP), if you choose SiteGround then you can make sure they are using apache for SocialEngine. To make browser cache optimization for SE4 you need to add this code to your .htaccess file.

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

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

<ifModule mod_headers.c>
# If you want to put any headers code here

<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 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
ExpiresByType text/css A17200

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

If you meet any problem with this code after adding it, please make sure you enable apache headers, expired and mod rewrite.

3. Enabling APC/XCache opcode caching for SE4

Opcode is source cache for PHP code, SocialEngine base on Zend Framework what work well with APC, so that if you own a server or hosting, you need to enable it to make sure PHP don’t take too much time every time it include and execute the source code.

If you choose from SiteGround hosting package then you can forget this step because they already did it for you.

4. Enable SocialEngine System Cache

Do these steps to enable SocialEngine 4 System Cache

  • Login to your account.
  • Click the “admin” item.
  • Go to the “Perfomance & Caching”.
  • On this page you can enable caching if there is a decrease in the perfomance of your social network.
  • You can enable or disable caching. Enabling caching will lower CPU usage and will make pages load faster.
  • With this option you can set how long the system will keep cached data.
  • With this option you can change the type of caching.
  • You can manually set the file-based cache directory where the cached data are stored. Please note that this folder must be writable (chmod 777).
  • Select either file locking or flush cache for the directory.

Now, you are almost done the basic steps, let ‘s keep continue.

5. Optimize images

Sometimes you use the images for your site what you choose the image quality is too much, it doesn’t make sense to show the too high definition image on a popular web browser. Let ‘s use this tools to have the full optimized images http://www.smushit.com/ysmush.it/

Update: for some  reasons, Smushit is not available anymore. You can use one of these tools to make your image optimized

6. CDN services

If you hear about cloudflare or Max CDN then they are 2 most popular the CDN (Content Delivery Network) world. CloudFlare have the free  package what included in almost Hosting cPanel, Max CDN need to pay to use and support really good for SocialEngine.

If you site have not too much traffic, let ‘s say <1000 visits/day then you can use free service from cloudflare, but if your site have much more traffic, you should upgrade to cloudflare pay package or use Max CDN


7. Minify JS/CSS

The static files take a lot of server resource if we don’t pay time enough for it. So that let ‘s combine and minify all of CSS and JS files, so we can save the number of requests to server and save time to transfer data. Of course, this will speed up your site a lot. And you know, in average, do this task can help you save roughly 50 requests static files per one main page request. Wow, it ‘s too much. Now let ‘s do it.

It ‘s easy to do by install and configure plugins, choose one of these plugin

8. Check SocialEngine speed and performance

There are some useful tools what can help you check if your work is effective or not. Try these free tools

Now you are done the job to speed up socialengine 4 (SE4), if you don’t see the performance change then please tell us your site here, we will tell you what happen there. Welcome your comment.



  1. Nice tutorial, but when I try to add the .htaccess code, it show me the internal server error, what wrong what that? Thanks.

  2. I do all of your steps and do the insight check and get the better result with score 90. Is this score work well or I need to do more tasks? Thanks

  3. That ‘s great! It speed up my se site more than 5x. It ‘s amazing tips for socialengine. Thanks team! Keep the good tutorial!

  4. Guys, my site suddenly meet problem with css loading, it doesn’t show correct, is it the problem come from minify? Thanks

    • You need to make sure you do the js coding well, let ‘s check “;” in the end of js object. Or you just need to combine, don’t remove blank page or new line.

      • Great, I did the check and it ‘s really the problem from me. Just correct it and then everything is working well. Thank guy, you are a great man.

  5. At least 4 times faster after I try your steps, thanks man. You save my money and my customers.

    • Thanks David, your comment bring us a lot of energy to write more article to speed up socialengine. But other than that, we will update this article usually to make it more useful.

  6. I see the CDN solution should be maxcdn since they are the #1 on the world. Cloudflare usually meet down time. Do you guys agree to me about that?

    • Yeah, downtime come with cloudflare usually, I think because they do the free stuffs so that they got too many free account. Other than that, I think paid service like maxcdn can be a good choice for anyone who willing pay for the good result speed.

  7. Anyone using Cloudflare have any tips? Procedure to setup ?

  8. Can you do the tutorial about apache + php + mysql tune for server so I can follow it to make sure my server is optimized? I see your tips above focus to client cache and server cache but not focus to server performance. Let ‘s say when my site reach 1M records in database, I need to do somethings to make sure Mysql server work stable because in anyway, it have to fetch database to show UI. Thanks a lot and looking forward to your article update. Thanks

  9. That ‘s cool, at least my site faster 4x after moving to new hosting and do some optimizations. Nice help. Thanks ad

  10. In your step 2 with .htaccess. I am not sure why it show me the internal error page if I use your code. Do you have any notice or why it ‘s happen? Thanks

  11. Did you do my tips and see what wrong?

  12. Hi,

    it seems smushit is no longer working.

    Can you recommend any alternatives?


  13. I really enjoy your post with a lot of useful stuffs for SE4. It almost take me a year before I see your post and choose the right hosting for my social site. It ‘s so nice and fast speed, fast support. Everything come with SiteGround is very smooth. I would recommend them to anyone. Again, thanks for your post what save me a lot of time to get a good hosting. You save my business too.

  14. It ‘s quite nice to see this tutorial. It can be considered as a best article for socialengine I has ever read. It save me a lot of time to speed up my social site. Now, it work amazing fast. Thanks author

  15. Thanks for the great article. I have an important question about CDN settings, and would appreciate your inputs.
    For MAXCDN, I need to add a DNS record by pointing CDN to MAXCDN url, and then enter, say https://cdn.xxxxx.com in Site Admin->General Settings->Static File Base URL. This process is well documented in public domain.
    However, for CloudFlare, I need to change the Name Servers to point towards them. There is no clear answer available anywhere if the Site Admin->General Settings->Static File Base URL needs to be updated in case of CloudFlare too. Also, do I need a CDN record in my DNS zone?
    Many thanks in advance for your help.

    • With CloudFlare, you just need to change the name servers, no need to do anymore step. Base on name server, CloudFlare will serve the cache automatically.

Leave a Reply

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