Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

  • john201502
    Participant

    @john201502

    Hi, thanks for your reply.
    I use Fastest Cache plugin, and I have previously excluded cache for the following specific paths.

    Contains: /members/
    /(.*)/members/(.*)

    I also used the following code in nginx’s conf:

    # /members/ specific rule
    if ($request_uri ~* “^/members/”) {
    add_header Cache-Control “no-cache, no-store, must-revalidate”;
    add_header Pragma “no-cache”;
    add_header Expires “0”;
    }

    But it didn’t help.

    Youzify didn’t mention the anti-proxy Buddypress plugin. They thought that I might not handle Ajax requests properly when using nginx anti-proxy, but they were not sure. They just confirmed that it was a problem with Buddypress, not Youzify. After I disabled Youzify, the problem still exists.


    john201502
    Participant

    @john201502

    I used this snippet but it doesn’t work.
    https://d6476bsmtk1fy.cloudfront.net/members/dontwait99/

    function disable_cache_for_buddypress() {
    if ( function_exists(‘bp_is_current_component’) &&
    (bp_is_current_component(‘activity’) || bp_is_current_component(‘members’)) ) {
    nocache_headers();
    }
    }
    add_action( ‘wp’, ‘disable_cache_for_buddypress’ );

    function add_nocache_to_ajax_requests() {
    ?>
    <script type=”text/javascript”>
    jQuery(document).ready(function($) {
    $.ajaxSetup({
    beforeSend: function(jqXHR, settings) {
    if (settings.url.indexOf(‘?’) > -1) {
    settings.url += ‘&nocache=’ + new Date().getTime();
    } else {
    settings.url += ‘?nocache=’ + new Date().getTime();
    }
    }
    });
    });
    </script>
    <?php
    }
    add_action( ‘wp_footer’, ‘add_nocache_to_ajax_requests’ );


    john201502
    Participant

    @john201502

    –You can try adjusting the cache settings for Ajax requests in CloudFront or configuring Buddypress to prevent caching of dynamic content.
    Thank you for your reply.could you please tell me how to configuring Buddypress to prevent caching of dynamic content?
    Thank you very much.

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar