Ravens PHP Scripts: Forums


View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - Feedback
Author Message
New Member
New Member

Joined: Apr 12, 2007
Posts: 12

PostPosted: Tue Nov 20, 2007 8:50 am Reply with quote

Whatever cache your using in this website such as ravenphpscripts.com/forums-posting-newtopic-f-177.html instead of php Smile would loooove to see that in new ravenuke i have tried to find someting like it and no luck, i`m usng ravenuke 2.10.1 and love it, but sick of paying $45 bucks per month for high CPU and i know this catch would help alot Smile

Thank you...
View user's profile Send private message
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17087

PostPosted: Tue Nov 20, 2007 10:52 am Reply with quote

Not sure what you are talking about. The forums aren't cached. Since you highlighted .html then I think you are referring to the use of Apache mod_rewrite. We rewrite the long urls to more SEO user friendly urls. If I have not understood then please let me know.
View user's profile Send private message
PostPosted: Tue Nov 20, 2007 1:33 pm Reply with quote

sorry about my english Razz i speak better than i type lol...

I have a website that gets about 4000 hits per day, and from $12 when up to $45 per month because evry host i tried complained about using a high CPU. even though i pay $45 per month on VPS server my website its still down on busy hours. I asked around and someone told me about some jpcatche that would make the .php to .html to visitors, so that way it wont bother the database for every little thing and the CPU will not be as high, someone else told me they got 80000 visits daily with maximum of 3.0 CPU and mine goes up to 7 at times. When i saw your pages show .html as well i tought your using that same program jpcatche or something like that dont remember the name Smile i found one and installed but nothing changed. Would you mind telling me how to do this whenever you have time?

Thanks in advence...
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Tue Nov 20, 2007 3:17 pm Reply with quote

Try Ravenswebhosting. PHPnuke is a dynamic system -- that means that it has to read from the database for every page load. Since the content can change at any time (one user for instance can be adding an article while another is reading them) there is no way to cache the content and just keep reusing the same html pages.

Within Ravennuke we've made a lot of progress in cutting down redundant SQL calls and there will be a lot more progress in the next version. But it still requires a lot of SQL access (100 calls for a single home page load is not unusual). That's not a problem for most hosts and you'd be well advised to find one that can support your workload.
View user's profile Send private message Visit poster's website
PostPosted: Tue Nov 20, 2007 3:24 pm Reply with quote

There are different type caches. jpcache has been around a while and is a good product. You don't necessarily have to turn .php into .html physically speaking. It's more the concept behind caching.

If you have content that hardly or never changes changes then that type content is what you want/need to target. I will assume for the sake of this discussion that you have a dynamic site in general, meaning that the content, for the most part, changes but with different frequency. I can't really get into a treatise on this subject but I will help where I can.

The caching mechanism that I use on this site is cachelite. It can be found at Only registered users can see links on this board! Get registered or login! It is simple and light weight and produces wonderful results. I actually have written a front end admin piece for it a few years ago and it still works well and I am still using it. You can check it out in my down loads. Do a search in the downloads for Cache Lite Admin Module For Nuke. But you don't need that to use cachelite - it just makes the facilitation a bit easier.

Getting back to the concept you need to divide up your site content into different content types. Something like

dynamic - changes too often to cache
dynamic - changes hourly
dynamic - changes daily

For static content there is absolutely no reason to generate it more than once. You could use the code you have right now and generate the page from php (example: page.php). Then do a view page source, copy it, and paste into a new file called page.html. Then your code would call page.html. It's caching in the sense that you have cached the output of you php program. That's an easy one but what if you have too many pages to do that? Then you need to get more into the automatic caching arena.

In general, the way caching works is that the output that is dynamically generated is save to a file and then the next time the php file gets called the caching mechanism checks to see if the content has changed. If so then it refreshes the cache by regenerating the php file and then replacing it in the cached file. There is still too much overhead to do this every time so we still need something more. Cachelite provides one way by allowing you to set a time that will have to pass before the script will get replaced. In other words it checks the date/time of the php file with the date/time of the cached file. If the timer has expired then it regenerates and the cycle starts all over again. For example, I have several blocks on my home page that are refreshed hourly, some daily, and some not at all. If something does happen to need refreshing before the allotted time you can do that by deleting the cached file and then refreshing the page that will regenerate it. That's where my front end comes in handy. It's basically a control panel that gives you a point-n-click ability to manage the refreshing. In any event, to add this kind of functionality only involves adding like 4 lines of code to your blocks. Here is an example - the Verse of the Day block on my site. The author only updates once a day so there is no reason to check more than once a day. Here is the code.

if ( !defined('NUKE_FILE') ) {
    Header("Location: index.php");
if (!$isCached) {
$content  = "";
$content .= "<!--BEGIN VOTD CODE-->\n";
$content .= "<script src='http://www.verseoftheday.com/kjvverse.js' type='text/javascript'></script>\n";
$content .= "<!--END VOTD CODE-->\n";
if ($cache) $objCache->save($content);

The first thing it does is call the cachelite script that checks to see if this block is supposed to be cached and if so, for how long. If it is then the date of the cached file is checked compared to the cached time allowed. If the time is up then the file gets regenerated. Otherwise it is loaded from the disk cache.

Basically most caches work in similar manner. But, if you really are seriously in need of major caching, then you will want to look at a commercial product that caches your scripts at the opcode level before it ever gets to the runtime. I hope that this has helped.

You might also want to read Only registered users can see links on this board! Get registered or login! as it discusses jpcache.

I have to step away for a bit but I have more information to give you Smile
PostPosted: Tue Nov 20, 2007 3:52 pm Reply with quote

Okay, continuing on, if you use Apache then these tips will help you a lot. I use this code or a variation of this code, in my .htaccess file. It would be even better if you can add them to your httpd.conf from I don't know that you have access to it.

FileETag none
<IfModule mod_expires.c>
ExpiresActive On
# ExpiresDefault A86400
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType application/x-javascript "access plus 5 minutes"
ExpiresByType text/css "access plus 5 minutes"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/plain "access plus 15 minutes"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType video/x-flv "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/html "access plus 5 minutes"
ExpiresByType text/javascript "access plus 5 minutes"
ExpiresByType application/x-javascript "access plus 5 minutes"

If you have compiled Apache with mod_expires then these lines help you to control when different file types expire. For more information this and many other great tips for performance boosting using Apache see Only registered users can see links on this board! Get registered or login!

There are also many ways to enhance your scripts as Frank has mentioned above. The biggest bang for CPU usage is probably MySQL so reducing queries and optimizing queries and the MySQL cache is ever so important.

Well, I'll shut up now and we'll see what happens Wink
PostPosted: Tue Nov 20, 2007 7:49 pm Reply with quote

man thanks alot Smile i`ve never been so confused lol. wish i had as much as knowledge as you do, till i found out about you my website was getting hacked daily Smile even 5 year olds would put a message telling me Admin your php has a bug fix it Smile than i heard about ravenuke and never had a problem since, however got a bit popular on some good ideas and now my hosting is killing me Smile i`ll try learning more about this tips, you`ve been an hero really and i very much appreciate it. I re-installed the jpcatch and will see how it goes with that. i just moved to new host and i`m just trying it for a month and i have no complains yet Smile but soon or later will come i just know it Smile this is my site Only registered users can see links on this board! Get registered or login! check when you get a chance and tell me what would it cost me to host it with you as fkelly suggested. Once again thanks for everything...
PostPosted: Tue Nov 20, 2007 10:44 pm Reply with quote

In order to provide you with a quote I need to know your monthly bandwidth and disk space requirements. Please use the Contact link on the home page with the information and I will get back with you. You can visit Only registered users can see links on this board! Get registered or login! for some sample packages and prices.

This site is what it is due to the many who offer financial, administrative, and time wise to help keep it going. If you find that we are a help to you, please consider a Only registered users can see links on this board! Get registered or login! Smile RavensScripts .
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - Feedback

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
Forums ©