cleaning cache while apache running

7,158 views
Skip to first unread message

Youngtae

unread,
Mar 16, 2011, 5:09:48 PM3/16/11
to mod-pagespeed-discuss
Hi

I have found how to clear cache on the server (
http://code.google.com/p/modpagespeed/wiki/FAQ#How_do_I_clear_the_cache_on_my_server?
)
But I am searching for the way to remove cached object while apache
running.

Must apache be restarted ? or What if cached objects are removed while
apache running ?
As I reviewed the source code such as file_cache.cc, cleaning cache
looked like find & rm shell command.


Shawn Ligocki

unread,
Mar 16, 2011, 5:15:50 PM3/16/11
to mod-pagesp...@googlegroups.com, Youngtae
There are two layers of caching. File cache and memory cache. You can remove a file from the cache/ directory while Apache is running, but that will not clear the memory cache. You can only clear the memory cache by restarting Apache.

-Shawn

Youngtae Kim

unread,
Mar 16, 2011, 5:20:56 PM3/16/11
to Shawn Ligocki, mod-pagesp...@googlegroups.com
thank you for your prompt response. 

Is the memory cache used always or by default? 
Can I turned it off? 

Thanks,
- Youngtae

Shawn Ligocki

unread,
Mar 16, 2011, 5:28:29 PM3/16/11
to Youngtae Kim, mod-pagesp...@googlegroups.com
You could probably set

ModPagespeedLRUCacheKbPerProcess 0

If you do, you might want to consider moving your file cache into a RAM.

Could you tell us a little more about why you want to do this?

Cheers,
-Shawn

Youngtae Kim

unread,
Mar 16, 2011, 5:50:00 PM3/16/11
to Shawn Ligocki, mod-pagesp...@googlegroups.com
Thank you.

I'd like to put some objects having longer TTL than 1 day on CDN servers. 
If mod_pagespeed rewrite them, CDN servers would be caching not only original objects but also the rewritten.

In this case, what should I do for modified original objects to be applied?
CDN services usually provide purge service which can remove cached objects.
I may have to request purging to CDN service after removing cached files by mod_pagespeed on my web server.
But I don't want to restart apache every time modifying original files.

let me know any idea other than removing cached file.

Thanks,
-Youngtae 

Shawn Ligocki

unread,
Mar 16, 2011, 6:10:49 PM3/16/11
to Youngtae Kim, mod-pagesp...@googlegroups.com
Note that the cache will be automatically updated at the TTL of the original resource. So if your original resources have TTL of a day and you update them, they will be served updated by tomorrow. If this is a development server, you can set the TTL shorter on the original resources.

We have been considering a way to do a cache purge while apache is running, but we have not done that yet.

-Shawn
Reply all
Reply to author
Forward
0 new messages