freeinternetpress.com Data Exists|
Free Internet Press
Free Internet Press is a long running work in progress. It started as a news blog, powered by Slashcode.
Slashcode is a big, robust, complicated, and server intensive software, or at
least it was when we were using it several years ago. We decided to change away
from it when this single site was too intensive to run on 3 servers (two web servers,
one database server). We operated Slashcode for about 1 year, after which we
switched over to PHPNuke.
PHPNuke was a much lighter application, which still had most of the capabilities
that we required. It was more flexible, but still had problems. One of the largest
was 3 separate defacement attacks which used exploits in the PHPNuke code.
With good backups, these defacement's were mitigated very quickly. It also
suffered, where spammers would constantly post to the comments through automatic means.
This part is common in popular software, as spammers only have to write a few versions of
their code to cover quite a few sites.
In 2005, we rewrote Free Internet Press from scratch in PHP. We maintained the
PHPNuke database at first, since it had a decent structure. The database was
modified and expanded upon over the next few months. All of the pages were rewritten
for high performance and security. The site flow was optimized, and provisions
were written to keep old links working.
The site has been coded to use significant page caching, although this is normally
kept to a minimum. Our logic is, a cache which can survive for 1 second protects
against heavy usage. Free Internet Press is frequently linked from Google News and Yahoo! News.
At times, we can see tens of thousands of requests an hour. The caching mitigates
most of this load. At 1 second, this can reduce the database requests from
25,000 to 3,600. By increasing the cache time to say 5 seconds, it would reduce
the database requests from 25,000 to 720. This implies one database request per
page, which isn't exactly accurate. There are multiple counters that are read
and updated, including the "times read", and "comments" counters.
The entire site was designed as blocks, which are simply included. This gives us
the flexibility required to make changes at will. For example, the front page
itself consists of approximately 15 included files, most of which are simple pieces
which can be reused elsewhere. We found it better to use smaller files to include,
rather than a massive include file with all the pieces.
The newsletter component of Free Internet Press is one exception for this site.
It is written in Perl. I prefer to have back-end applications written in Perl,
but PHP is more fluid for web use. The languages are so similar, it's still very
easy to maintain.