Forum Moderators: coopster
Since all my pages are in PHP, I was thinking with each non-homepage page load, I can have a MySQL table be written to adding that document to the top of the list, and then delete the 11th item on the list (keeping the list at ten items).
Then on a homepage load, it could read the MySQL table and grab all the links and put them into the special section.
I see this as possible, but also needlessly server intensive.
What would a better approach to this be?
I'm thinking about it, and I don't think the link section needs to be live-to-date. Maybe every 15 minutes--or more--if it would help?
What would a less server intensive approach be to get a feature like this?
Thanks for any suggestions.
use custom logging to split your server logs so that your primary logs only have page requests and everything else goes to another log
you can see this in this library [webmasterworld.com] thread
Getting PHP session variables into your Apache logs [webmasterworld.com]
just the last part of the first post
now, have a cron run every 15 minutes that grabs the last ten lines off of your log and writes the filenames to a text file that can be included in your homepage.
some ideas here
displaying the last 20 lines from a logfile [webmasterworld.com]
would depend on a fair bit, like having that kind of control in apache, but an idea all the same