The cache is working like a charm now. Unfortunately the problem on the MySQL servers is getting worse. This is what happens if you are with a shared hosting provider. Now all urls are automatically cached, except those that have a query string (?pid=223, ?from=9 or similar). With some advanced mod_rewrite this could be tackled too, but the MySQL problem has to be resolved or a new host has to be found. Every page that has comments enabled will now be cached every 20 minutes, thus allowing the comments to show up, while every other page is only generated if I make updates to the websites. I will keep a close eye on the cache to see if some unexpected things show up (for instance the poll did not work right initially).
I made a lot of changes under the hood of this site.
I have had troubles with MySQL performance recently, so I decided to implement a file cache. Now most of this site is served by cache.
Some pages are still not cached. Due to the nature of the cache (it generates html files from the MySQL database) not everything can be cached 100%.
For example, when you browse Gallery Thumbnails and klick on the "2", the url will change to something like ....html?from=9. Since this would otherwise access the same html file and nothing would happen, this page will be generated dynamic.
For now I have only the cache fetching running. I created the cache manually once.
Once the cache generator program is complete, it will cache every page that does not have the comment feature enabled, once a week and every page that has the comment feature enabled once per hour (or more often). For this to be effective, I will change the comment system to only allow comments on galleries, not individual pictures.
In the past, I have been hit numerous times daily by a Spam-Bot. Those are programs that automatically generate comments on websites with links to shady websites. This will illude Google to think these sites get linked a lot and thus rank them higher. Even after disabling links in my comments, the bots proofed to be quite stupid and continued posting. So from now on, all comments will require my approval. On the bright side, this allows me to enable full html support (so you can post your url if you like).
Once the cache has been implemented correctly, I will take care of the comments. Sorry for all the inconvenience, but at least now my site runs lightning fast again.
As I said not everything is and can be cached. You can actually find out by looking at the source of the page you are on. There will be some html comment indicating that it is static on the bottom of the code.
There are more advantages to the cache. While I can maintain all the comfort of a content management system, my site will stay functional, even when the MySQL server goes down or when I am being hit hard by a bot.
Some sloppy programmed crawlers also had trouble with the Base HREF setting of my CMS. I know I should lock them out by blocking their IP, but at least now I won't see the failed request with infinite URL's anymore.