Support » Plugin: Super Progressive Web Apps » Exclude URLs from cache?

  • Resolved macwinson

    (@macwinson)



    Hi guys, great solution!!! I wonder if there is an easy way to choose some URL to be excluded from the caching, for instance, “site-domain.com/contact-form/” or any other? If it’s necessary I can ad some code to functions.php child theme file.
    Thank you!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jose Varghese

    (@josevarghese)

    Add this filter to the functions.php file to exclude contact-form page

    /**
     * Exclude /contact-form/ 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 . ',/\/contact-form/';
    }
    add_filter( 'superpwa_sw_never_cache_urls', 'superpwa_exclude_from_cache' );

    This will ensure that page /contact-form/ is excluded from Service Worker’s caching strategy. You can also have a look over our filter doc section here.

    Hi Jose, I’ll definitely try this ASAP. Thank you!!!

    Plugin Author Jose Varghese

    (@josevarghese)

    Thanks for the reply and eagerly waiting to know your thoughts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.