This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Is this an efficient way to run commentics?
#1

Hello,

I have a 200 page flatfile site which uses includes to get some of the side panel content, menu etc. I wanted to check that the way I do my commentics is efficient for performance and if there wasn't something obvious I should do differently

top of page:
Code:
<?php
session_start();
ob_start();
ob_start("ob_gzhandler");
?>

I had gzhandler in there before coming to commentics, it's gzip compression for performance.

I call all CSS in one file and don't have the seperate css call in these files.

After head and menu I hardcode identifier, reference, path, define in commentics and parse for url which I use to display socials. Socials similar to commentics calling in the graphics there so I don't have multiple ones to maintain.

Then a php bloc to get # of comments on its own (thank you Steven) so I can show that in orange at the top of the page and use a local anchor to let people jump there.

Finally at the bottom of the page the cmtx_form itself, slimmed down for performance.

Finally an sitewide right hand side include that has a SQL query getting the last 5 comments and page hrefs

At the end this, don't know if it's helpful though:

Code:
<?php
ob_flush();
ob_flush();
ob_clean();
ob_end_flush();
?>

example here (note, in progress site, not ready yet). Load times seems to vary quite a bit, it's on a shared server so maybe other stuff is eating CPU. But between .5 and 10s. I'm not unhappy just want to make sure I'm not doing anything bonkers. Basically just after any thoughts that SQL and PHP propeller heads might have, am I committing any cardinal sins here performance wise or does this look ok.

Thx!!
Reply
#2

I removed this, seems to be causing 'premature end of script headers'
Code:
<?php
ob_flush();
ob_flush();
ob_clean();
ob_end_flush();
?>
Reply
#3

Edited out - tried to remove but forum not letting me
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
19-Feb-2020, 10:26 AM
Last Post by kbadmin
28-May-2019, 07:16 PM
Last Post by bobby
10-Oct-2015, 10:11 PM
Last Post by finzer
30-Apr-2015, 09:12 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)