Skip to content

Static cache not invalidated for multisite #6397

@stuartcusackie

Description

@stuartcusackie

Bug description

I have a blog collection and entries are localised. I'm noticing that my Static Cache Invalidation rules work for my default site, but not for my subsites.

The problem occurs on my blog index page: /blog

If I unpublish an entry from the default site then it disappears from the index on the default site but if I unpublish the same entry from the subsite it remains on the blog index on the subsite.

My cache invalidation rules are like so:

'rules' => [
  'collections' => [
    'blog' => [
      'urls' => [
        '/blog'
      ]
    ],
   .....

I'm using blade and this is how I retrieve entries for the blog index:

@php($tag = Statamic::tag('collection:blog')->paginate(12)->sort('date:desc')->as('articles')->fetch())

I have tried 'rules' => 'all' and it works so this seems like a bug to me. I can't see any problems with my rules.

How to reproduce

Not sure. Set up a multisite collection and unpublish the article from each site to see if it's outputted on your collection index page.

Logs

No response

Environment

Laravel Version: 9.22.1
PHP Version: 8.1.1
Composer Version: 2.2.3
Statamic Version: 3.3.24

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

No response

Additional details

No response

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