WordPress with nginx + memcached -- without PHP

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
511 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Sep 13, 2011

Running WordPress with a nginx+php-fastcgi+memcached backend. Display cached pages without touching PHP, e.g. even if your php backend goes down, cached content will still be served. Requires some kind of memcached-compatible caching plugin for WordPress, e.g. Batcache or W3 Total Cache.

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (gakoe)

  • Excellent video.

    I tried to use the W3 Total Cache, but it inserts the additional data in the page cache, and nginx receives a corrupted data from memcache, at the top of the site page I see characters like a: 4: {i: 404; b: 0; s: 7: "headers "; a: 0: {} s: 4:" time "; i: 1325687950; s: 7:" content "; s: 39 298"

    (I also patch files / wp-content/plugins/w3-total-ca­che/lib/W3/PgCache.php for easy setup $ memcached _key in nginx. conf)

    Do you have any ideas how to make it work?

  • @pendostan2009 I had to modify W3 Total Cache. By default, it stores the content as an array in memcached, along with header information (like 404's). You can see the customizations I made here: gist.github com/1561344

    Note that you will no longer get 304s, your cache can no longer store the create time so it can't send that in the header, only 200s.

  • @pendostan2009 Another thing to note: PHP will compress data in memcached over a certain threshold, and when nginx reads that data out -- since it's not PHP, it doesn't know how to uncompress data. So you need to change your php.ini or memcache.ini not to compress data < 1MB: memcache.compress_threshold=10­48576

see all

All Comments (4)

Sign In or Sign Up now to post a comment!
  • Thank you very much! It worked really well with your PgCache.php!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more