FacetWP – different cache depending on whether the user is an admin

<?php

add_action( 'wp_head', function() {
    $role = current_user_can( 'manage_options' ) ? 'is-admin' : 'non-admin';
?>
<script>
(function($) {
    $(document).on('facetwp-refresh', function() {
        FWP.extras.role = '<?php echo $role; ?>'; // cache buster
    });
})(jQuery);
</script>
<?php
}, 100 );