eZ Community » Forums » General » clear cache with a command line???????
expandshrink

clear cache with a command line???????

clear cache with a command line???????

Thursday 18 December 2008 9:14:11 pm - 13 replies

Can anyone tell me how to clear all the cache of my site besides using the website administration interphase via a gui??? my administration interphase is blank!!! I hope that once I get to clear all the cache it will work again!! I read about using some commands but they don't work...

Modified on Thursday 18 December 2008 9:16:03 pm by Lizeth Lorenzana

Friday 19 December 2008 10:23:55 am

Try php bin/php/ezcache.php --clear-all --purge in the ezpublish instalation directory.

Sunday 19 July 2009 1:37:24 pm

Hi,

I'm using this command since a long time, but it seems that on new versions (4.x) image aliases are not cleared.

I'm obliged to clear all caches via the admin interface in order to delete the aliases.

Is there a way to clear them with a line command ?

Sunday 19 July 2009 3:24:38 pm

Hello Sébastien,

Try clearing cache by tag!

<b>Examples:</b>

cd /web/ez/doc;
./bin/php/ezcache.php --clear-tag=image
./bin/php/ezcache.php --clear-tag=image --purge

See the list of tags in the software [0]

Cheers,
Heath

[0] <i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/ezcache.php</i>

Modified on Sunday 19 July 2009 3:25:26 pm by // Heath

Sunday 19 July 2009 4:30:09 pm

Hi !

Thanks for your reply, but the --clear-tag=image doesn't do the trick.

I follow this steps :

1) first load of my webpage, image are resized in 400x300 because of their alias declaration in image.ini
2) second load of my webpage, image are in cache
3) I edit the image.ini to change alias dimension from 400x300 to 420x300 by example
4) I purge the caches with ./bin/php/ezcache.php --clear-tag=image --purge
5) I reload the webpage : images are still in 400x300, my browser cache is disabled
6) I clear all caches via the backoffice
7) I reload the webpage : images are well in 420x300

So I think that ezcache.php doesn't do the trick...

Sunday 19 July 2009 4:50:29 pm

Hmm,

Well are you certain your current shell user has full permissions to remove these files (prolly).

I would read the related part of the kernel module php api [0]

If your clearing all cache it seems that that form post action would trigger this part [1] of the eZ Publish PHP API.

eZCache:clearAll [2]

Cheers,
Heath

[0] <i>http://pubsvn.ez.no/nextgen/trunk/kernel/setup/cache.php</i>
[1] <i>http://pubsvn.ez.no/nextgen/trunk/kernel/classes/ezcache.php</i>
[2] <i>http://pubsvn.ez.no/doxygen/trunk/html/classeZCache.html</i>
[3] <i>http://pubsvn.ez.no/doxygen/trunk...l/ezcache_8php-source.html</i>

Sunday 19 July 2009 5:08:48 pm

Yet most people should not want to clear all cache so broadly, so often and look for a more granular approach.

In this situation as I think about the problem at hand. Problem: Change Image Alias Settings; Require clearing which caches?

I would suggest the following consider clearing: ini, template, image, content

Also make certain your settings are configured to clear the appropriate VarDir (I've seen this prevent clearing cache before).

Cheers,
Heath

Sunday 19 July 2009 7:05:45 pm

@Sébastien

I'm fairly certain that the last time I was testing new image aliases a couple of months ago on a 4.03 release that I was clearing the image aliases from the command line - after, of course, being all confused that the image aliases were not being regenerated after I deleted the cache files from the file system.

I don't remember exactly what I was using but I believe I used both --clear-tag=image and --clear-id=image-alias

Actually, as an aside, what's the difference between a tag and an id anyway?

Sunday 19 July 2009 7:29:43 pm

Thanks all for your help,

I have runned the ezcache.php script in root : same problem, image aliases are not deleted, both with ./bin/php/ezcache.php --clear-all --purge and ./bin/php/ezcache.php --clear-tag=image --purge

The VarDir directive is OK in site.ini...

PS : I just would like to use this command line purge when I'm in development in order to have not to wait the form post process of the "backoffice clear all caches" who's longer than the command line script.

Modified on Sunday 19 July 2009 7:33:45 pm by Sébastien Antoniotti

Sunday 19 July 2009 7:30:40 pm

@ Steven E. Bailey

It seems --clear-tag groupings of ids in a general way.

While --clear-id seems specific way to clear specific cache directly.

@ Sébastien

Try this attempt at another possible example

 ./bin/php/ezcache.php --clear-tag=image --clear-id=imagealias --purge
# or
./bin/php/ezcache.php --clear-tag=image --clear-id=imagealias
Clearing image: Image alias
Clearing imagealias: Image alias

See the static list of tags and ids available, <i>http://pubsvn.ez.no/doxygen/trunk...he_8php-source.html#l00058</i>

Cheers,
Heath

Modified on Sunday 19 July 2009 7:33:41 pm by // Heath

Sunday 19 July 2009 7:38:00 pm

OK !

You're right, <b>./bin/php/ezcache.php --clear-tag=image --clear-id=imagealias</b> do the job !

Does it mean that there's no way to clear ALL caches without having to list all the tags in one command line ?

Modified on Sunday 19 July 2009 7:40:43 pm by Sébastien Antoniotti

Sunday 19 July 2009 7:48:58 pm

Are you certain you have not tried this example,

./bin/php/ezcache.php --clear-id=imagealias --clear-all --purge

Also try these commands to learn more

./bin/php/ezcache.php --list-tags;

./bin/php/ezcache.php --list-ids;

./bin/php/ezcache.php --help;

You could create a simple shell wrapper script which provides a simple one program no agruments way to clear cache you need cleared on a regular basis via command line.

Cheers,
Heath

Modified on Sunday 19 July 2009 7:51:36 pm by // Heath

Sunday 19 July 2009 8:05:58 pm

I hate typing all those long paths all the time!

I make a symbolic link to the script in the ezpublish root directory.

cd /web/dev/ez;  ln -s bin/php/ezcache.php clr;

Cheers,
<i>//kracker</i>

Sunday 19 July 2009 8:49:18 pm

I agree but is not it strange that --clear-all make less job than a --clear=image-tag ?

@kracker

Mee too, and personnaly I use a .bashrc alias blunk.gif Emoticon

Modified on Sunday 19 July 2009 8:49:46 pm by Sébastien Antoniotti

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu