Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/www/domains/hppgallery_com/design/defaulttheme/tpl/pagelayouts/main.php on line 59

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/www/domains/hppgallery_com/design/defaulttheme/tpl/pagelayouts/main.php on line 59
Monday, August 21, 2017
 

Delay Image Hit From Access Log

It's a third option witch can be used for image hit's counter. It requires less resources from system. And speed's up image render window by around 20%. By avoiding insert on each image preview.

Since r560 there are new settings options.

'delay_image_hit_log' => false,
      'delay_image_hit_log_settings' => array (      
      'host' => false,
      'log_path' => '' // Absolute path to log     
      ; ), // If host == false all host will be matched otherwise check if access has domain. Host can be an array

Things you have to do to activate this feature:

1. Set delay_image_hit_log to true.

'delay_image_hit_log' => true,

2. Set host properly. It can be false or array of hosts. If access log is just for your domain you can leave host property as is. If access log also logs requests from other domains you can set this variable to:

'host' => array('example.com','www.example.com'),

Make sure that delay_image_hit_enabled is set to false

'delay_image_hit_enabled' => false,

3. Set log_path to access.log file

'log_path' => '/var/log/lighttpd/access.log'

4. Configure cronjob. In this example we scan log file for new records every five minutes. and update delay image hit table.

*/5 * * * * cd /path/to/site/root && /usr/bin/php bin/php/update_view_count.php > update_counter_log.log /dev/null 2>&1

Make sure that also, that this command is also present. This command will update images hits self.

*/5 * * * * cd /path/to/site/root && /usr/bin/php cron.php -s site_admin -c gallery/cron  > image_counter.log
Back »

Comments: 0

Leave a reply »

 
  • Leave a Reply
    Your gravatar
    Your Name
     
     
     
     
 
About HPPG

High performance photo gallery dedicated for large numbers of image storage.

Get in touch

Donate



Download