Gallery cache

debsparrow1

Joined: 2008-10-12
Posts: 64
Posted: Sun, 2010-11-07 06:15

Because our inodes build up very quickly in the cache directories, I have just set up a cron job to clear the cache in the g2data/cache directory. I've only just had the thought that Gallery might be storing thumbnails there. I'm hoping you can tell me it's safe to clear that directory on a regular basis. We've been clearing the cache using Gallery's 'clear database cache' option and thought it would be the same thing but automated.

Last Run Details:

Gallery URL = http://richardarmitagecentral.co.uk/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.14 cgi-fcgi
Webserver = Apache mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Database = mysqlt 5.1.50, lock.system=flock
Toolkits = ArchiveUpload, Getid3, LinkItemToolkit, ImageMagick, Thumbnail, Exif, Gd
Acceleration = none/0, none/0
Operating system = Linux gator481.hostgator.com 2.6.34.6 #86 SMP Tue Oct 12 20:10:03 CDT 2010 i686
Default theme = carbon
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; en) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/4.1.2 Safari/533.18.5
Rows in GalleryAccessMap table = 25
Rows in GalleryAccessSubscriberMap table = 80912
Rows in GalleryUser table = 2
Rows in GalleryItem table = 80631
Rows in GalleryAlbumItem table = 416
Rows in GalleryCacheMap table = 0

 
delfin78

Joined: 2009-07-24
Posts: 26
Posted: Sun, 2010-11-07 10:36

so you can clear the cache Maintenance (Cached HTML pages, photo albums and data, modules, settings, theme settings, Smarty templates, temporary directory, Download plugin cache, Install / Upgrade log files, thumbnails and resize (expensive to rebuild))
This feature can be found on "yourpagegallery" / lib / support / index.php

 
debsparrow1

Joined: 2008-10-12
Posts: 64
Posted: Sun, 2010-11-07 11:27

Hi Delfin78. Thank you. However, when I go to

yourpagegallery / lib / support / index.php

It brings me to the following google page.

http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=yourpagegallery+%2F+lib+%2F+support+%2F+index.php#hl=en&&sa=X&ei=04rWTLusIIqmvgO6vamWCQ&ved=0CBIQvwUoAQ&q=yourpage+gallery+/+lib+/+support+/+index.php&spell=1&fp=2f34ac94631f2187

From there I've gone to

Gallery2:FAQ - Gallery Codex

Which, of course, brings me to the G2 FAQ page. I did look at that earlier. However, I couldn't see anything that answered our problem. That could be because none of us working on the site have html language. We are currently using the 'Clear Database Cache' option in Maintenance twice a week. However, this is becoming insufficient, so we thought we would set up a cron job to organise it to be done daily. The breakdown of inodes is:

[root@gator481 /home/racadmin/g2data]# for x in *; do echo $x `find $x |wc -l` done
albums 80626
cache 192631
index.html.LCK 1
locale 1
locks 177
plugins_data 300
smarty 98
tmp 10
upgrade_1152cf1357.log 1
upgrade_fed6ca2837.log 1
versions.dat 1

[root@gator481 /home/racadmin/g2data]# for x in cache/*; do echo $x `find $x |wc -l`; done
cache/derivative 81591
cache/entity 109885
cache/module 740
cache/repository 1
cache/theme 413

Because we have set the cron job to clear the g2data/cache directory, and we don't know where the additional data files gallery creates are kept, we just need to be sure that we're not going to lose anything necessary.

We really appreciate your help.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2010-11-07 17:14

Replace "yourgallery" with your actual website and try again. I.E. use http://richardarmitagecentral.co.uk/lib/support/

--
dakanji.com

 
debsparrow1

Joined: 2008-10-12
Posts: 64
Posted: Mon, 2010-11-08 08:45

Hi Dayo. Thank you. Just so I'm clear - and please forgive me for being anal but our gallery holds about 80,000 pics and it's a very active website so I'm extremely nervous about anything catastrophic happening. (Think of me as a learner-driver.) What that's saying is anything in cache - meaning in this instance anything in g2data/cache and g2data/cache/entity - can be safely deleted and won't impact on data files like thumbnails or resized pics.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2010-11-08 14:22

Definitely *don't* delete anything in /cache/derivative, or you'll be rebuilding thumbnails and resizes for a very long time.
Everything else is good to go.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2010-11-08 15:48

Use the link and clicking on the button there will be a safe cache delete. As long as you don't activate the ones with the warnings.

--
dakanji.com

 
debsparrow1

Joined: 2008-10-12
Posts: 64
Posted: Tue, 2010-11-09 04:38

Hi alecmyers.

Great. So, if I want to set up an automated job it should delete cache/entity NOT data/cache.

Cool.

Thanks a bunch.

 
debsparrow1

Joined: 2008-10-12
Posts: 64
Posted: Tue, 2010-11-09 04:44

Thanks. You've been really helpful and I do appreciate your patience. However, from what I'm seeing that's a manual job - something akin to the cache delete function in the Maintenance options which we're using twice weekly. What we're looking for is a way to do it automatically. The cache builds really quickly. At the moment it's going from 193,000 to over 300,000 in a couple of days because the site's getting about 400 hits a day and most of them are going to the gallery.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Tue, 2010-11-09 16:42

You could set up a cron job to delete the relevant folders ... everything under g2data/cache apart from derivative.

--
dakanji.com

 
debsparrow1

Joined: 2008-10-12
Posts: 64
Posted: Wed, 2010-11-10 00:59

Thanks. That's what we'll do. You've been incredibly patient and helpful. Thank you.