My elgg site is very slow so I want to make it faster, I have the codes, but I dont know where to insert them so please help me.
First of all to cache my site
$offset = 60 * 60 * 24; // Cache for a day
header(‘Content-type: text/css’);
header (‘Cache-Control: max-age=’ . $offset . ‘, must-revalidate’);
header (‘Expires: ‘ . gmdate (“D, d M Y H:i:s”, time() + $offset) . ‘ GMT’);
Whre do I insert these headers
Second is gzip compression I use this
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();
DO I have to add this in every file or just one or two main files will do the trick
Please reply A.S.A.P
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Ibrahim Hasan@ibro

Ibrahim Hasan - 0 likes
- slyhne@slyhne

slyhne - 0 likes
- Ibrahim Hasan@ibro

Ibrahim Hasan - 0 likes
- slyhne@slyhne

slyhne - 0 likes
- ihayredinov@ihayredinov

ihayredinov - 0 likes
- DhrupDeScoop@Dhrup2000

DhrupDeScoop - 0 likes
You must log in to post replies.Please help me
I do not think this will help.
Are you running on a shared server or dedicated server?
Shared
I know it wont help alot but atleast it will make it a bit faster
so If anyone could tell me where I need to add the code snippets
You could extend page/elements/head with your code in a plugin.
If something that simple can speed up Elgg, then please report back :-)
The first snippet is already built into Elgg. Caching is handled by Elgg, just make sure you have simplecache enabled.
As for gzip compression, I don't think there is one specific place. You would need to go through all handlers and lib/views and see which ones use ob_start()
have you looked at apache2's mod_deflate instead of mod gzip ?