Skip to content

Busting cache on endpoint/element changes #47

@AwakenTheJaken

Description

@AwakenTheJaken

Is there any way to turn caching on, but bust the cache when that endpoint/element changes through the cms? At the moment the caching is working great, but I have to manually bust the cache any time anything on the cms side changes. Is this the expected behavior and if not -- am I missing something here?

'api/v2/faqs.json' => [
    'cache' => 'PT1M',
    'elementType' => 'Entry',
    'criteria' => [
        'section' => 'faq'
    ],
    'transformer' => function(EntryModel $entry) {
        $categories = [];
        foreach($entry->faqCategory as $category){
          $categories[] = $category->id;
        }
        return [
            'title' => $entry->title,
            'answer' => (string)$entry->answer,
            'categories' => $categories,
        ];
    },
],

Thanks so much for the absolutely AWESOME plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions