Thanks to Bob (CaveatLector) with the following message, we discovered an error within the code that sets 'Expiry', which keeps it at 1 hour, regardless of the parameter setting:
Alex, thanks very much for making your Conteg class available. I was contemplating writing something similar myself, without fully understanding what would be involved, when I found a link to your code at WebmasterWorld.com. Wow, what a project! Not only did that require lots of coding, but also must have required lots of research into (or prior knowledge of) relevant standards. I am very impressed.
I was able to quickly implement Version 0.12.2 at a test site running under Apache 2 on a Windows 2000 Advanced Server. I watched resulting headers using Live HTTP Headers in Firefox as I experimented with various Constructor parameter array options. Everything worked as expected until I tried to change 'expiry'. Header 'expires' times default an hour into the future regardless of 'expiry' values passed to the class Constructor or the settings of other options.
Joined: 04 Oct 2006 Posts: 2 Location: Salt Lake City, Utah, USA
Posted: Mon Oct 16, 2006 1:51 pm Post subject: Conteg.include v0.12.3 Results
This is a note to let anyone interested in Alex’s Conteg,include class know that the fix in v0.12.3 corrected the header expiries problem I previously reported.
It also is to report a substantial benefit from using Conteg. Since implementing Conteg on a site with php-generated web pages about ten days ago my daily AdSense earnings have increased approximately 40 percent. Of course, AdSense earnings deviate daily for many reasons and it is rarely, if ever, possible know the causes with certainty. However, my daily earnings have become much more stable over the years as the number of unique visitors has grown from 100 per month at the outset of the AdSense program to the present 50,000 per month (as reported by awstats). The 40 percent earnings jump every day since Conteg implementation is unusual and convinces me of the importance of reporting meaningful (real) “Last Modified” dates in HTTP headers.
I should add that sites with fewer visitors wouldn’t be apt to have the immediate earnings jump I experienced, because Google doesn’t fully index sites with low levels of activity as often. My site was fully indexed a few hours after Conteg was implemented which made it possible to have quick benefits.
Joined: 30 Jun 2004 Posts: 5175 Location: Nottingham, England
Posted: Mon Oct 16, 2006 6:35 pm Post subject: Wow! I'm lost for words (almost)
Since implementing Conteg ... my daily AdSense earnings have increased approximately 40 percent.
I mean... wow!
I can see the advertisement strapline now...
Hmm. As an immediate benefit, my concentration has always been on the bandwidth reduction it affords. Current stats for October show an 80% reduction thanks to the use of compression (from AWStats, www.modem-help.com only; 4.51 GB reduced to 918.59 MB; 15 days, 32,468 visitors, 128,288 pages, 819,782 hits). Total reduction is far higher, of course, thanks to caching (proxy + browser), 304s, etc. etc.. Next was the warm, moral glow of doing The Right Thing on the web, and also of knowing that you were getting pages to site visitors just as quickly as it was humanly possible to do so (the positive side-effect of all that reduction in page-size and caching). It never, ever occurred to me that there would also be such a positive lift to the bottom line. Makes sense, though.
Gosh, what an interesting report. Thanks for the feedback, CaveatLector. My cheque is in the post (just kidding, OK?)
The key to accurate reports with AWStats is an up-to-date listing of bots, to isolate human-hits from bot-hits. To under-score this point, currently in October there are 128,288 human-inspired pages from this site, and 101,213 "Not viewed traffic" pages. The Googlebot and Adsense-bot have recorded 49,094 pages all by themselves.
Since I installed AWStats in May 05 I have, in my usual obsessive er, er (damn this truth bug) erm, typically diligent fashion, been finding new bots each month and keeping AWStats updated with them. You can download the robots.pm and benefit from that diligence. _________________ Alex Kemp
Joined: 30 Jun 2004 Posts: 5175 Location: Nottingham, England
Posted: Wed Feb 18, 2009 2:55 pm Post subject:
Fatal error: Cannot redeclare Conteg::$if_match in /var/www/Conteg.class on line 130
That error can only occur if you are using one of the following:
...more than once.
It can NOT occur if you exclusively use one of the following:
...no matter how many times you have the statement in your script(s).
Check your coding, and particularly your include()-ed files. You are re-declaring the Class more than once within the flow of your program. It is designed to be declared just a single time - you can instantiate as many instances as you wish (although it does not make much sense to do that either).
As a useful tip, I have a single script that is used site-wide, and thus use:
...at the top of all my scripts. The 'site-wide-script.include' file declares & sets all global variables and also contains all user-functions that need to be available site-wide. Such global variables are identified in my scripts with a leading underscore. In addition, instances of Classes in my scripts always begin with a Capital Letter. Hence the use of `$_Encode' in the example in my previous post.
The reason for the practice outlined in the previous paragraph is the same reason for using Classes: encapsulation. Once thoroughly debugged the global-script can be forgotten, since it 'just works'.
PHP does not care what you call your files. The `.php' suffix is, mostly, derived from 16-bit Windows' practice. _________________ Alex Kemp
Everything is Ok
# mv Conteg.0.13.6.txt Conteg.class
# joe test.php # this is the exact replica of your test script above
# /usr/bin/php-cgi test.php
PHP Notice: Conteg::Conteg: output buffering switched ON; any output before this point will trigger errors when headers are sent. in /root/temp/Conteg.class on line 2203
The PHP Notice is to warn that output buffering is NOT switched on at instantiation, and that the Conteg constructor has just done so.
There is something else on your system that is causing your error. You will need to report your version of PHP in addition to the version of Conteg that you are testing. _________________ Alex Kemp
Posted: Wed Apr 15, 2009 4:31 pm Post subject: Hy there :)
Thanks for reply.
I use: Conteg 0.13 downloaded from phpclasses.
PHP Version 5.2.6
The first problem was that i receive an error about redeclare of $if_match.
I take a look in class and found 2 $if_match. One in line 130 and other in 133 and are same. I added // to line 133 so i escape that Fatal error.
Then, i receive another error about that cannot open /proc/loadavg because base_opendir is not allowed (on some server is disabled as you know..).
So, i look for some fix and i found that we can acces cpu avarange with unix command...
Now seems that he take cpu avg and all error / notice disapear.
Now, i must read again what about this class to see how realy work and what realy do because i didn`t understand all because i didn`t have time ..
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