How to cache POST requests with Boost Boost reacts and caches only GET requests. Does anybody know how to force it to cache POST requests too e.g. using specific key param in URL?

Or at least how to call Boost method that caches request and method that check whether this page exists in cache?

Update : 

Answer below is good and marked it as an answer but i decided that i am not so familiar with Boost and Drupal to go so deep so now i am using Boost for cashing GET requests and my own module to cache POSTs. Boost works faster because it uses redirects within HTACCESS but it requires additional setup. Even though method below is a little slower it allowed me to change execution of my AJAX from 5 seconds to 900 ms in average.

My module : 

It maybe absolutely wrong so do not think that this is a recommendation, just keep in mind that this is easy enough even without Boost.

// I am caching AJAX POST requests and thus separate these actions by URL params

function customactions_init() {

    $template = null;
    $cache = isset($_REQUEST['cache']);

    if ($cache) {

        switch (true) {
            case isset($_REQUEST['views']) : $template = json_encode((array) $_REQUEST['views']); break;
            case isset($_REQUEST['nodes']) : $template = json_encode((array) $_REQUEST['nodes']); break;
            case isset($_REQUEST['loaders']) : $template = json_encode((array) $_REQUEST['loaders']); break;
        }

        $cache = DRUPAL_ROOT . '/sites/cache/' . md5($template);

        // if file cache was found - use it and stop everything else

        if (is_file($cache)) {
            die(file_get_contents($cache));
        }
    }
}

// Define some static path - can be moved somewhere to config

function customactions_get_directory() {
    return DRUPAL_ROOT . '/sites/cache/';
}

// Returns path to cached content that was built based on URL params

function customactions_get_key($params) {
    return customactions_get_directory() . md5(json_encode((array) $params));
}

// Clear cache when some node changes

function customactions_node_presave($node) {
    @array_map('unlink', glob(customactions_get_directory() . '*'));
}


Any template file, e.g. page.tpl.php : 

&lt;?php

    $nodes = array();
    $ids = array_unique((array) $_REQUEST['nodes']); // Get node IDs from AJAX

    foreach ($ids as $k =&gt; $v) {
        $nodes[$v] = drupal_render(node_view(node_load($v))); // Create nodes
    }

    ob_start(); // Start buffering output
?&gt;

&lt;div id="page-node-wrapper" class="page-container"&gt;
    &lt;?php print sonifi_render(sonifi_device() . '/header.php') ?&gt;
    &lt;div id="content"&gt;
        &lt;?php print implode('', $nodes) ?&gt;
    &lt;/div&gt;
    &lt;?php print views_embed_view('footer', 'default'); ?&gt;
&lt;/div&gt;

&lt;?php 

    $output = ob_get_clean(); // Closing buffer

    // If module and its function are enabled then create cache file

    if (function_exists('customactions_get_key')) {
        file_put_contents(customactions_get_key($_REQUEST['nodes']), $output);
    }

    print $output; // otherwise show content as usual
?&gt;
You would need to do 2 things. Create your own hook_init that runs after boost_init to modify the global $_boost['cache_this'] value &amp; use hook_boost_cookie_handler_callback_alter to write your own boost_cookie_handler function that works with POST.

To check if the page exists in the cache the boost_block_view_status() function has the parts needed but it has not been abstracted out so you would need to create your own function to do this.

That will cache POSTs.

If you want to serve from the cache on a POST (ignore the post) in your htaccess file remove RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR].

A lot of things can go wrong if doing this. It's a bad idea 99% of the time.