User and group avatar loading and site performance

Hello everybody,

I 'm fighting with a performance problem of my elgg 1.8.20 site (page loading greater than 8 seconds). I analyzed the site with gtmetrix to understand what  could be the reason.

Waterfall analysis showed that avatars took more than 5 seconds to load, The first point of the YSlow  was that there were 22 static  components (many of which avatars icons) with not a far future expiration date. I set up my apache server with headers and expirations for many type of files.

My question is how to speed up avatar loading? How can I set up headers in my .htaccess file in order to assign the correct header to avatar or other image-like files?

PLease, can someone help me.

 

  • Upgrade to 2.1. We have been working hard to mjnimize the impact of static resources on performance. :)
    Two things you should do:
    1. Rewrite your handlers to serve files without booting the engine. You can dig into hypeApps icon server.
    2. Send proper cache headers. You can probably downgrade this to 1.8 https://github.com/hypejunction/elgg-proxy. It's part of core now

  • Make sure system and simple caches are on, and add a proxy cache in front of Elgg.

    All those avatars, group icons, and static resources will be served from the cache instead of hitting PHP. That reduces the problem to serving HTML files faster and other front end optimizations.

  • 1.8 does in fact send future Expires headers with avatars, group icons, file thumbnails, and /cache URLs. E.g.: https://github.com/Elgg/Elgg/blob/1.8.20/mod/profile/icondirect.php#L61

    You might be getting a false report from YSlow, which is abandonware. But point is these are all heavy resources to send from PHP that would zoom out of a proxy cache.

  • Thank you Ismayil and Steve for your answers,

    I rewrote profile/icondirect.php and group/icon.php commenting the engine/start.php calls but I have no expertise to how downgrade the elgg-proxy for elgg 1.8 for serving the proper cache headers. Can someone help me? 

    I cannot upgrade my elgg at the moment because I have 30 plugins for that version and upgrading the core will mean upgrade the majority of my plugins.

    I also activated a CDN for improving security and caching of static resources but when the hit is missing the page load time increases to 10 seconds

    Can you please   

  • help me

    Thank you for your incredible work

  • Furthermore, system and simplecache are enabled for my elgg system as well as a Turbo cache service in my hosting.

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.