| Posted in Website Programming » PHP - Sunday 21st October 2007 at 9:14PM | |
|
adam2z Joined October 2005 |
i need a new, less process intensive way of logging hotlinks. __________________________________ |
- Subscribe to this
- Search this thread
- Rate this thread
logging hotlinks..?
Replies (2)
| Replied - Monday 29th October 2007 at 11:31PM [Post Link] | |
|
Will Joined October 2005 |
Proxy PHP script is equal to death. Try using an Apache directive to direct to a PHP file, log to a .txt file differentiated on a day by day basis and then display the image by using cURL (faster, less resource intensive) or using header then include, or file_get_contents. To be honest I've forgotten which one is better, but the one that is is better by far.
Instead of doing multiple queries per second (potentially), you're going to be accessing a .txt file, probably in a CSV format (I would recommend it) and then using a cron job to process the data into MySQL. Obvious drawbacks would be the fact this would not be realtime (at least not through MySQL) however it's going to be a few quick accesses. Try benchmarking it and investigating what you find. __________________________________ |
| Replied - Thursday 1st November 2007 at 4:46PM [Post Link] | |
|
Will Joined October 2005 |
[QUOTE] PHP.net said: file_get_contents() is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to enhance performance. __________________________________ |