Moving mod_pagespeed’s file-based cache into RAM
Google's mod_pagespeed does a great job at optimising web resources such as HTML, JS, CSS and even images.
I use it on a lot of customer production sites as a great partner to APC cache for super fast web sites.
I won't go into details on how it works, if you're reading this, you already know!
mod_pagespeed caches resources to disk. If you are running on a heavily loaded server or a VPS, disk IO is a premium.
So we should really cache to memory, its faster, cheaper and easy to set up.
Put this in /etc/fstab, please change the uid & guid to the appropiate user & group of your apache webserver, and the path to your needs. Feel free to change the size (here it is 256Mb) and set to use the httpd user.
tmpfs /var/www/mod_pagespeed/cache tmpfs size=256m,mode=0775,uid=httpd,gid=httpd 0 0
Save it, and after that mount the tmpfs:
mount /var/www/mod_pagespeed/cache
mod_pagespeed will now be even faster!
Related posts
- Simple install of memcached on Ubuntu
Memcached is a free, high performance distributed memory object caching system. In English, it can... - Using Persistent Cache in WordPress (with APC)
Ever since WordPress 2.5, the WP Cache functions haven't been persistent, so the cached objects... - [Snippet] Create a large file in Linux
Need to create a large file? For disk speed tests? Or space tests? This will... - WP Super Cache – I’m impressed
Pictures speak better than words... WP Super Cache has shaved nearly 3 seconds off the... - Fixing cPanel File Permissions
Sometimes users mess with their own file permissions that they no longer work. They will...


