Forum Moderators: coopster
I'm currently working on a theming setup that uses strings as placeholders for specific information.
The format of these strings are [v:varname], and they are replaced by a series of foreach loops as it loops through the content of the page to be displayed.
The page itself is built off of a general template in the format:
[v:header]
[v:content]
[v:footer]
header and footer are defined in the theme setup, and content is assigned by the php before the replacement is done. After this initial replacement, another foreach loop run must be done in order to ensure that all the variables have been replaced where they need to be.
This whole setup has proven to be very inefficient and very cpu intensive. I need a better way to do this, can anyone help?
Thanks,
C
I don't have any cpu issues, but:
1) I run a php caching program (zend opt, phpa, etc)
2) Once a page is generated, I store the output for 5-10 minutes. If the page is loaded again during that time, it's issued from cache instead of being created from scratch.
3) My server has 2 gigs of ram and dual xeon cpus, so it deals pretty well with the 160k/day page views. Just one site on the server.
Unfortunately though, I can't figure out a good way to cache the page because of the way cookies influence the layout.
I'm in the process of reducing the number of foreach() loops, I'm hoping that, in combination with some other things, will speed things along..