kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Moving mod_pagespeed’s file-based cache into RAM

Posted on January 27, 2012

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.

  1. 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:

  1. mount /var/www/mod_pagespeed/cache

mod_pagespeed will now be even faster!


Related posts

  1. Simple install of memcached on Ubuntu
    Memcached is a free, high performance distributed memory object caching system. In English, it can...
  2. Using Persistent Cache in WordPress (with APC)
    Ever since WordPress 2.5, the WP Cache functions haven't been persistent, so the cached objects...
  3. [Snippet] Create a large file in Linux
    Need to create a large file? For disk speed tests? Or space tests? This will...
  4. WP Super Cache – I’m impressed
    Pictures speak better than words... WP Super Cache has shaved nearly 3 seconds off the...
  5. Fixing cPanel File Permissions
    Sometimes users mess with their own file permissions that they no longer work. They will...

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.