3

I am installing a pre-build php-based web application for a client. Unfortunately the application performs very slowly because it compiles lots of data. Page load times go up to 40 sec.

I know about ob_caching but I don't want to mess with the application unless it is absolutely necessary.

Are there any tools/scripts/apache modules to cache the entire output of the application statically one the server and update it on a regular basis. I am just looking for a middleware or something which build regular static html pages form the php application. (BTW: I tried eaccelerator, but it didn't improve the situation.)

I would appreciate any tips. Thanks in advance.

1
  • 1
    Don't forget to upvote and choose as Best Answer the answer that helped you most. Commented Jun 10, 2013 at 9:23

2 Answers 2

2

eAccelerator should have made a measurable difference, so are you sure it was installed correctly? You should have seen an eaccelerator section in phpinfo() showing that the cache was full. You may also have ahd the cache set too small etc. Alternatively, try APC instead. If neither show any performance improvement, you may have a server issue.

In any case, 40 seconds is crazy slow for anything. Are you sure this is PHP and not poorly optimised SQL queries?

Sign up to request clarification or add additional context in comments.

4 Comments

My guess would be that he has some code in there that's doing something really silly, or a few monster SQL queries with no indexes. Before you do ANY performance optimization (including caching), you should PROFILE YOUR CODE to find out where the problem actually is.
@KeithPalmer +1 for that. I recommend xdebug profiler: xdebug.org/docs/profiler
Thanks for the answers so far. Yes I know I should look at the code. As I said I didn't build it so I thought it would be less work if I don't even touch it and just cache the hell out of it. :D Maybe this isn't the best idea... Just to give you an idea: The application is reading an ics (calendar) file and putting it in a nifty little web based display. It's called phpicalendar. Maybe its just bad... :D
@webstyler Doesn't sound like it should be taking 40 seconds for any reason! Good luck with the analysis. You may find it's something you find quite fast once you profile it.
0

Looks like this should do the trick (but YMMV, depending on your application):

http://httpd.apache.org/docs/2.2/mod/mod_cache.html

2 Comments

Good idea. But I think unless I improve the application significantly mod_cache wouldn't help. I want to create static pages to improve speed. But reading the comments above this may is not a good idea.
Hence YMMV. You did ask for a middleware solution :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.