• Resolved a.c

    (@ac-1)


    Hello,
    Thank you for creating this fantastic plugin.

    I’ve noticed the plugin is not automatically flushing the cache for any Request URIs with the _fields parameter specified.

    Is this behavior expected?

    For example:

    1. List tags with _fields param:
    GET /wp/v2/tags?page=1&_fields=id,slug
    Returns: Tag1, Tag2, Tag3

    2. Create a new tag:
    POST /wp/v2/tags (data: {name: 'Tag0'})

    3. List tags with _fields param again:
    GET /wp/v2/tags?page=1&_fields=id,slug
    Expected Return: Tag0, Tag1, Tag2, Tag3
    Actual Return: Tag1, Tag2, Tag3

    Listing tags without the _fields parameter specified consistently returns the expected data.

    Thanks,
    Aaron

Viewing 1 replies (of 1 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @ac-1

    Thank you for using our plugin!

    Yes this is expected behaviour. The plugin uses the fields id and taxonomy to determine the correct object type when requesting a (custom) taxonomy endpoint. And it uses the fields id and type when requesting a (custom) post type endpoint.

    As you can probably see when you go to Settings > WP REST Cache > API Endpoint Caches, you will see the “Object Type” column displaying ‘Unknown’ for your calls.

Viewing 1 replies (of 1 total)

The topic ‘Cache is Not Automatically Flushed When `_fields` Parameter is Specified’ is closed to new replies.