tarlejh Posted September 10, 2008 Share Posted September 10, 2008 For everyone's consideration (suggestions or ideas are welcome): On a load-balanced, high-traffic website, a small section of content (a list of images, text, and links) on the homepage changes weekly. Further, this content pulls from an array in random order. I had the idea to pull this content from a database so I could write a simple CRUD interface for this section as a wordpress plugin (until we devise a comprehensive CMS solution); however, our site is too busy to add this call to the database. We already have server-side caching in place and have done plenty of other optimizations. In fact, adding to the dilemma is that these images would best be stored as a single file accessed through a CSS sprite rather than as several image files. For you PHP experts, my question is: Bearing in mind that the content needs to change only weekly, what are some strategies for making this dynamic and editable, while not sacrificing performance or risking it as a performance issue? Link to comment https://forums.phpfreaks.com/topic/123629-strategies-for-minimizing-database-calls/ Share on other sites More sharing options...
lanmonkey Posted September 10, 2008 Share Posted September 10, 2008 heres an idea: put the array (from which the homepage content is take) into its own php file and include it somewhere near the top of your script, so every time the homepage is loaded this array is created without any DB calls. Then create another php file that can be called once a using a cronjob, this php file will pull the info from the DB, dynamically create the php code to create the array and save it in the first php file. So you get all your content displayed on the home page with only 1 DB call a week. Link to comment https://forums.phpfreaks.com/topic/123629-strategies-for-minimizing-database-calls/#findComment-638418 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.