diff --git a/README.txt b/README.txt
index b8c868b..a1a1473 100644
--- a/README.txt
+++ b/README.txt
@@ -9,7 +9,7 @@ storing in database.
 
 Built-in Drupal cache uses database backend.  There is one SQL query
 for each accessed cache entry.  This is much slower than simple file
-access as used by filecache module.  
+access as used by filecache module.
 
 memcache module is the closest caching module. File Cache can be
 configured to use memory filesystem (e.g. /dev/shm in Debian) which is
@@ -80,6 +80,17 @@ $conf['cache_backends'] = array('sites/all/modules/filecache/filecache.inc');
 $conf['cache_default_class'] = 'DrupalFileCache';
 $conf['filecache_directory'] = '/tmp/filecache-' . substr(conf_path(), 6);
 
+* USING IGBNARY
+
+In case you want to use igbinary, enable it in your settings.php and make sure
+that you enabled PHP igbinary extension.
+
+$conf['filecache_igbinary_enabled'] = TRUE;
+
+After configuration, don't run the website or it will crash. You need to go to
+filecache directory on server (which is filecache_directory setting), delete
+that folder.
+
 * NOT IMPLEMENTED YET: filecache_fast_pagecache
 
  #$conf['filecache_fast_pagecache'] = TRUE;
diff --git a/filecache.inc b/filecache.inc
index c4631d5..cc81406 100644
--- a/filecache.inc
+++ b/filecache.inc
@@ -8,6 +8,26 @@ define('FILECACHE_CID_FILENAME_MAX', 200);
 // 34 is '%_' + 32 hexdigits for 128-bit MD5
 define('FILECACHE_CID_FILENAME_POS_BEFORE_MD5', FILECACHE_CID_FILENAME_MAX - 34);
 
+if (variable_get('filecache_igbinary_enabled', FALSE) &&
+    function_exists('igbinary_serialize')
+) {
+  function _filecache_serialize($value) {
+    return igbinary_serialize($value);
+  }
+
+  function _filecache_unserialize($value) {
+    return igbinary_unserialize($value);
+  }
+}
+else {
+  function _filecache_serialize($value) {
+    return serialize($value);
+  }
+
+  function _filecache_unserialize($value) {
+    return unserialize($value);
+  }
+}
 
 function filecache_directory() {
   $filecache_directory = variable_get('filecache_directory', FALSE);
@@ -101,7 +121,7 @@ class DrupalFileCache implements DrupalCacheInterface {
     if ($content === FALSE) {
       return FALSE;
     }
-    $cache = @unserialize($content);
+    $cache = @_filecache_unserialize($content);
     if ($cache === FALSE) {
       // we are in the middle of cache_set
       $fh = fopen($filename, 'rb');
@@ -112,7 +132,7 @@ class DrupalFileCache implements DrupalCacheInterface {
         fclose($fh);
         return FALSE;
       }
-      $cache = @unserialize(@stream_get_contents($fh));
+      $cache = @_filecache_unserialize(@stream_get_contents($fh));
       if ($cache === FALSE ||
           flock($fh, LOCK_UN) === FALSE ||
           fclose($fh) === FALSE) {
@@ -193,7 +213,7 @@ class DrupalFileCache implements DrupalCacheInterface {
     $cache->data = $data;
 
     if (ftruncate($fh, 0) === FALSE ||
-        fwrite($fh, serialize($cache)) === FALSE ||
+        fwrite($fh, _filecache_serialize($cache)) === FALSE ||
         flock($fh, LOCK_UN) === FALSE ||
         fclose($fh) === FALSE) {
       // XXX should not happen -> cleanup
@@ -291,7 +311,7 @@ class DrupalFileCache implements DrupalCacheInterface {
       if ($content === FALSE) {
         continue;
       }
-      $cache = @unserialize($content);
+      $cache = @_filecache_unserialize($content);
       if ($content === FALSE) {
         continue;
       }
@@ -327,7 +347,7 @@ class DrupalFileCache implements DrupalCacheInterface {
         if ($content === FALSE) {
           continue;
         }
-        $cache = @unserialize($content);
+        $cache = @_filecache_unserialize($content);
         if ($content === FALSE) {
           continue;
         }
