Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need a way to flush the mod_pagespeed cache while developing. According to mod_pagespeed documents, I should run the following command:

sudo touch /var/mod_pagespeed/cache/cache.flush

In Debian it's "su" instead of "sudo". However, it doesn't work for me; there's no "touch" command, nor is there any "cache.flush" file in the defined directory. Have I missed something?

You kick-ass Linux users, please be humble - I'm pretty new to these stuff.

Thank you in advance!

share|improve this question
How did you install mod_pagespeed onto your system? There is no package for it in the Debian repository. How you installed it could greatly influence where the files are located. –  Zoredache Oct 6 '12 at 0:28
Most folk just use the pre compiled .deb on the official Google code page. –  Sonassi Oct 6 '12 at 0:30
I used the pre-compiled .deb indeed. Thanks for the unjustified downvote. –  Ivar Oct 6 '12 at 13:10

2 Answers 2

up vote 3 down vote accepted

If touch is missing you've got MUCH bigger problems (coreutils is one of the Essential packages). I think more likely you tried to swap su for sudo but didn't change the commandline. You'll need:

su -c "touch /var/mod_pagespeed/cache/cache.flush"

(...or you could install and setup sudo.)

I've never used mod_pagespeed, but the path looks suspect to me, at least with respect to normal Debian packages. Typically caches would end up in /var/cache/package/ rather than /var/package/cache, but if this wasn't an official package then the packager may have decided to organize files by package rather than purpose. If the /var/mod_pagespeed/cache/ directory exists then you're probably in the right place. It seems likely to me that the cache.flush file would be deleted once the cache has finished being flushed, in which case you shouldn't normally find it there.

share|improve this answer
Absolutely brilliant - worked like a charm. :-) –  Ivar Oct 6 '12 at 13:13
The "touch" thing, is it only for mod_pagespeed or is it used elsewere i Debian? I'm just curious about the line. –  Ivar Oct 6 '12 at 13:14
Using files to execute one-time commands is used in a few different places. For instance, in most distributions if you create a forcefsck file in /, the system will run fsck on all the drives when you next boot. The touch program is separate from this process. touch does one of two things: if you use it on a file that doesn't exist, it creates an empty file. If you use it on a file that does exist, it updates the modification time. Thus, touch is a convenient way to create these files, but not the only way. –  DerfK Oct 6 '12 at 17:43

Since you have told us very little about how you actually installed that piece of software I suggest what you need to do is a little investigation.

Try running updatedb, followed by locate cache.flush if you have mlocate installed. This should show you any files with that name on the filesystem. If there is more then one you should be able to easily guess which one it is base don the directory it is in.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.