Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Cachify does not actually cache cookies. I assume you want to exclude cache generation/display when a user request contains a certain cookie?

    You can achieve this using the cachify_skip_cache hook, e.g.

    add_filter(
      'cachify_skip_cache',
      function( $skip ) {
        return $skip || isset( $_COOKIE['cookie_name'] );
      }
    );
    

    If you use HDD caching with direct webserver configuration, you need to extend this as well.

    nginx
    Extend

    if ( $http_cookie ~ (wp-postpass|wordpress_logged_in|comment_author)_ ) {
      return 405;
    }

    with cookie name as required:

    if ( $http_cookie ~ (wp-postpass|wordpress_logged_in|comment_author)_|cookie_name ) {
      return 405;
    }

    Apache (htaccess)

    Extend

    RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_

    to

    RewriteCond %{HTTP_COOKIE} !((wp-postpass|wordpress_logged_in|comment_author)_|cookie_name)

    Cheers,
    Stefan

    Thread Starter bercikborisgmailcom

    (@bercikborisgmailcom)

    ok thank you

    Thread Starter bercikborisgmailcom

    (@bercikborisgmailcom)

    resolved

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cookies caching exception’ is closed to new replies.