• Resolved ukbestrong

    (@ukbestrong)


    Hi,

    I absolutely love this plugin!

    I would like to exclude the following pages from the cache: –

    my-groups
    create-new-group
    groups
    activity
    members
    user
    account

    Is there a snippet I could add?

    Best wishes,

    Rick.

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

    Good day to you. You can simply use our filter superpwa_sw_never_cache_urls to exclude caching of pages.

    Also you can find more details about the usage of filter over here

    Thread Starter ukbestrong

    (@ukbestrong)

    apply_filters( 'superpwa_sw_never_cache_urls', '/\/wp-admin/,/\/wp-login/,/\/my-groups/,/\/create-new-group/,/\/groups/,/\/activity/,/\/members/,/\/user/,/\/account/,/preview=true/' );

    That’s great Jose! Is this correct?

    • This reply was modified 5 years, 2 months ago by ukbestrong.

    Copy paste the below code on functions.php

    /**
     * Exclude my-groups, create-new-group, groups, activity, members, user account from SuperPWA cache
     * 
     * @link https://superpwa.com/codex/superpwa_sw_never_cache_urls/
     */
    function superpwa_exclude_from_cache( $superpwa_sw_never_cache_urls ) {
    	return $superpwa_sw_never_cache_urls . ',/\/my-groups/,/\/create-new-group/,/\/groups/,/\/activity/,/\/members/,/\/user/,/\/account/';
    }
    add_filter( 'superpwa_sw_never_cache_urls', 'superpwa_exclude_from_cache' );
    Thread Starter ukbestrong

    (@ukbestrong)

    Jose! You are an absolute superstar!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Exclude pages from cache’ is closed to new replies.