My lazy solution for slow page generation

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
fearofcorners

My lazy solution for slow page generation

Post by fearofcorners »

I've started using CMS made simple for my personal website. I host it on a cheap and pretty lame web host, so the page generation is pretty slow (particularly MySQL lookups).

I was getting about 1.5s page load time, which is too much in my books. In order to combat this, I tried using the caching add-on. This cut the reported page generation time down to about 0.5s, which was much better.

Still, it's not as fast as true static content. I came up with a quick'n'dirty hack that speeds up my site enormously: I'm just caching the output of cmsms wholesale. For anyone interested, I've attached my code. I expect this will break search, since it will cache results. I don't use search so I haven't added a bypass for searches.

For those interested, I've attached my code.
I chose not to use the php gzip file operations since I expect cpu is a more valuable resource than disk on my host. It is a trivial change to make, just subsitute gzopen/gzeof/gzread for fopen/feof/fread.

To use these files you need to rename index.php and stylesheet.php in cmsms's base folder to index_normal.php and stylesheet_normal.php before uploading their replacements. Oh, and rename these from .txt to .php of course. I had to do that because this forum won't let me upload .php files.

Clearing the cache is easy enough, just rm -f ./indexcache/*. Ideally there'd be something which would clear the specific page's cache when the page was edited. I might look through the cmsms code and see if I can find somewhere to insert such a nugget of code.
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

Last edited by fearofcorners on Sat Feb 09, 2008 5:52 am, edited 1 time in total.
Vin

Re: My lazy solution for slow page generation

Post by Vin »

Maybe you'd be interested in this thread
Post Reply

Return to “Developers Discussion”