{"action":"created","issue":{"url":"https://api.github.com/repos/SocialEngine/phpv4-issues/issues/194","labels_url":"https://api.github.com/repos/SocialEngine/phpv4-issues/issues/194/labels{/name}","comments_url":"https://api.github.com/repos/SocialEngine/phpv4-issues/issues/194/comments","events_url":"https://api.github.com/repos/SocialEngine/phpv4-issues/issues/194/events","html_url":"https://github.com/SocialEngine/phpv4-issues/issues/194","id":97277937,"number":194,"title":"Reduce HTTP Requests","user":{"login":"Elshara","id":12810222,"avatar_url":"https://avatars.githubusercontent.com/u/12810222?v=3","gravatar_id":"","url":"https://api.github.com/users/Elshara","html_url":"https://github.com/Elshara","followers_url":"https://api.github.com/users/Elshara/followers","following_url":"https://api.github.com/users/Elshara/following{/other_user}","gists_url":"https://api.github.com/users/Elshara/gists{/gist_id}","starred_url":"https://api.github.com/users/Elshara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elshara/subscriptions","organizations_url":"https://api.github.com/users/Elshara/orgs","repos_url":"https://api.github.com/users/Elshara/repos","events_url":"https://api.github.com/users/Elshara/events{/privacy}","received_events_url":"https://api.github.com/users/Elshara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-26T02:41:24Z","updated_at":"2015-08-26T10:37:07Z","closed_at":null,"body":"Social engine supports a system that has a ton of http requests built in referencing every database call, many css and javascript files and other codes depending on each widget that is installed. Not only is it loading php code, but a bunch of other unnecessary files as well, constantly making database requests and slowing down the site. Although stable, it is probably slower than word press on a good day and there are many things that can be improved with this, the solution is more simpler than you may think.\r\n1. Eliminating the dependent cms aspect to things will speed up things. It isn't just about cache, cache shouldn't be necessary if the files themselves made more server requests than external file requests per a database query or session. Social engine ought to do away with mootools and use jquery or an external javascript library to make things load faster. Do away with zend template engine and install something a lot faster. Twig, smarty, blade, phalcon, jinja, tenjin, vanilla js, mustache, node.js, Nunjucks, ur/web haskell, jade, Dwoo Php, Fry Php, Tornado, Mako, Webpy, Amazon Dynamo, Jango, Pyramid, Erb.\r\n2. Make blocks more accessible. Currently, any module that has to connect to a database has to do so through several entries at once. If there was a core database file it could simply read user data from at its core and then just add a layout and a controller, it would be much easier than having to specify custom templates.\r\n3. Include 1 CSS file. A huge percentage of social engine load times relies on images, and there are a lot, especially if you have a lot of entries per module instance let alone content and or its attachments. Make css not inline, so the only css that needs to load is for what page you are actually viewing, reducing the need to have more than 1 global css file. Ideally, there should not be any inline css files to load. Javascript on the other hand should have a global file and then add in ones required for content management as needed. They are a little harder to track down, especially when having to reference specific templates. Reducing the need to have templates, but instead have a global template with different files referencing core functions per instance therefore would generate all the css necessary for that page.\r\n4. Make code a little less compressed, more simple. Looking at source code such as menus, you see a lot of instances where it references a different type of object located in another file. Independent dependencies slow things down because it loads things from the same page even though the files are actually very different, which is why so many database queries tend to be called. It is very time consuming because the code takes about 100 times as long to download than the actual content, and that includes simultaneously loading several iframes and rss feeds on one page, mainly due to image requests, but also due to extra unneeded file queries from within a given document assuming and depending on the need for a members potential call to action.\r\n5. This can be proven by looking at the page source code. Generally the line numbers are in the hundreds, but for the page load time, should be several thousand lines in actuality. Gzip compression takes care of this to a certain degree however it makes no difference to how fast the page actually loads. Google averages about 6 to 12 seconds with just default plugins installed and not very much content at all. Most platforms load pages at about the 0.5 second mark, so you can see where social engine is lagging big time, especially when it comes to relying on third party items like a chat to work while the server is constantly processing a lot more http requests than it has to. At peak times, it can even delay a script from refreshing at all, especially when relying on ajax calls to do so like activity feed updates and notifications.\r\n6. Too many dependency checks resulting in potential zend errors cause problems. Such checks relies on queries to ensure all files are in place before the page can load at all. The more widgets you have, the longer this takes, especially if the widgets are third party plugins. Ironically tags take the most time to load, because that as well as search makes content queries last longer provinding it has to find all available links to compile into a page. This is especially true when referencing things like the members profile information fields. The tags take too long of a query to process so they time out, resulting in no links or a time out to actually process a post once awaiting a response.\r\n7. Double seo header information exists on all pages. Not only is it loading header information for global seo, but for specific page seo as well and compiling it into one place in the header, even though it is served from one file, as a template, makes extra queries to get the info even though it isn't as fatal as say queries referencing functions users may not wish to perform. Those take the longest, and image caching isn't a priority when this occurs.\r\n8. Speaking of image caching, the temporary directory never gets deleted or updated. This should be a requirement via cron job and database dump. The reason for this is so that when files do load, a lot more server memory can handle the requests, rather than checking temporary files to see if they are in fact up to date. On first page load, this takes the most resources to complete after timing out."},"comment":{"url":"https://api.github.com/repos/SocialEngine/phpv4-issues/issues/comments/134940048","html_url":"https://github.com/SocialEngine/phpv4-issues/issues/194#issuecomment-134940048","issue_url":"https://api.github.com/repos/SocialEngine/phpv4-issues/issues/194","id":134940048,"user":{"login":"meetgerry","id":8540750,"avatar_url":"https://avatars.githubusercontent.com/u/8540750?v=3","gravatar_id":"","url":"https://api.github.com/users/meetgerry","html_url":"https://github.com/meetgerry","followers_url":"https://api.github.com/users/meetgerry/followers","following_url":"https://api.github.com/users/meetgerry/following{/other_user}","gists_url":"https://api.github.com/users/meetgerry/gists{/gist_id}","starred_url":"https://api.github.com/users/meetgerry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetgerry/subscriptions","organizations_url":"https://api.github.com/users/meetgerry/orgs","repos_url":"https://api.github.com/users/meetgerry/repos","events_url":"https://api.github.com/users/meetgerry/events{/privacy}","received_events_url":"https://api.github.com/users/meetgerry/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T10:37:07Z","updated_at":"2015-08-26T10:37:07Z","body":"Wish if someone from the SE team comments something here !"}}