chitchatter Posted October 13, 2009 Share Posted October 13, 2009 I am relatively new to PHP, mysql and have a forum with 10,000 topics. On one page I display all the topics created in that forum. My code goes like this if cache file is less than 24 hours old; include cache file; else SELECT topic_id, topic_title FROM topics_table WHERE forum id NOT IN (x,y,z); fwrite output to cache file; echo output; end if; The resultant query gives an output/cache file that is 10,000 rows, 1.3Mb unzipped and 300kb gzipped in size. Is there a better way to do this other than to break up the output into several pages? Link to comment https://forums.phpfreaks.com/topic/177534-solved-help-needed-optimizing-a-php-page/ Share on other sites More sharing options...
GKWelding Posted October 13, 2009 Share Posted October 13, 2009 short answer, no, not if you're wanting to display ALL topics on 1 page. however, I would suggest getting rid of the cache file and paginating instead, that way you wont have a cache file that's hours otu of date, you'll have a constantly up to date connection to your DB. Link to comment https://forums.phpfreaks.com/topic/177534-solved-help-needed-optimizing-a-php-page/#findComment-936076 Share on other sites More sharing options...
chitchatter Posted October 13, 2009 Author Share Posted October 13, 2009 Thanks Welding, I wished to keep all the topics on one page but I guess I will have to go in for pagination before I hit the server limits. Link to comment https://forums.phpfreaks.com/topic/177534-solved-help-needed-optimizing-a-php-page/#findComment-936090 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.