-
-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Statically cached pages not removed when moving a page #9531
Comments
Can you please provide |
@jasonvarga sure: <?php
return [
/*
|--------------------------------------------------------------------------
| Sites
|--------------------------------------------------------------------------
|
| Each site should have root URL that is either relative or absolute. Sites
| are typically used for localization (eg. English/French) but may also
| be used for related content (eg. different franchise locations).
|
*/
'sites' => [
'default' => [
'name' => config('app.name'),
'locale' => 'nl_NL',
'url' => '/',
],
],
]; |
Can you try using the app url as the site's URL instead? Like this: 'default' => [
'name' => config('app.name'),
'locale' => 'en_US',
- 'url' => '/',
+ 'url' => config('app.url'),
], |
@duncanmcclean sure, I now have the following config: 'default' => [
'name' => config('app.name'),
'locale' => 'nl_NL',
'url' => config('app.url'),
], However, the problem persists 🙁 |
Is the Just checking since ^ fixed some invalidation issues for others recently so want to make sure it's not the same issue here. |
Just double-checked it, and yes, it's In case it helps, my <?php
return [
/*
|--------------------------------------------------------------------------
| Active Static Caching Strategy
|--------------------------------------------------------------------------
|
| To enable Static Caching, you should choose a strategy from the ones
| you have defined below. Leave this null to disable static caching.
|
*/
'strategy' => env('STATAMIC_STATIC_CACHING_STRATEGY', null),
/*
|--------------------------------------------------------------------------
| Caching Strategies
|--------------------------------------------------------------------------
|
| Here you may define all of the static caching strategies for your
| application as well as their drivers.
|
| Supported drivers: "application", "file"
|
*/
'strategies' => [
'half' => [
'driver' => 'application',
'expiry' => null,
],
'full' => [
'driver' => 'file',
'path' => public_path('static'),
'lock_hold_length' => 0,
],
],
/*
|--------------------------------------------------------------------------
| Exclusions
|--------------------------------------------------------------------------
|
| Here you may define a list of URLs to be excluded from static
| caching. You may want to exclude URLs containing dynamic
| elements like contact forms, or shopping carts.
|
*/
'exclude' => [
'class' => null,
'urls' => [
//
],
],
/*
|--------------------------------------------------------------------------
| Invalidation Rules
|--------------------------------------------------------------------------
|
| Here you may define the rules that trigger when and how content would be
| flushed from the static cache. See the documentation for more details.
| If a custom class is not defined, the default invalidator is used.
|
| https://statamic.dev/static-caching
|
*/
'invalidation' => [
'class' => null,
'rules' => [
'collections' => [
'events' => [
'urls' => [
'/agenda',
'/',
]
],
'news' => [
'urls' => [
'/nieuws',
'/',
]
],
'testimonials' => [
'urls' => [
'/ervaringen',
'/'
]
],
'vacancies' => [
'urls' => [
'/vacatures'
]
]
],
'taxonomies' => [
'vacancy_audiences' => [
'urls' => [
'/vacatures',
]
],
'vacancy_branches' => [
'urls' => [
'/vacatures',
]
],
'vacancy_cities' => [
'urls' => [
'/vacatures',
]
],
'vacancy_hours' => [
'urls' => [
'/vacatures',
]
],
'vacancy_industries' => [
'urls' => [
'/vacatures',
]
],
'vacancy_regions' => [
'urls' => [
'/vacatures',
]
],
],
'globals' => [
'newsletter' => [
'urls' => [
'/*'
]
],
'overviews' => [
'urls' => [
'/*'
]
],
'social_media' => [
'urls' => [
'/*'
]
],
],
'navigation' => [
'headermenu' => [
'urls' => [
'/*'
]
],
'footermenu_primary' => [
'urls' => [
'/*'
]
],
'footermenu_secondary' => [
'urls' => [
'/*'
]
],
]
],
],
/*
|--------------------------------------------------------------------------
| Ignoring Query Strings
|--------------------------------------------------------------------------
|
| Statamic will cache pages of the same URL but with different query
| parameters separately. This is useful for pages with pagination.
| If you'd like to ignore the query strings, you may do so.
|
*/
'ignore_query_strings' => false,
/*
|--------------------------------------------------------------------------
| Replacers
|--------------------------------------------------------------------------
|
| Here you may define replacers that dynamically replace content within
| the response. Each replacer must implement the Replacer interface.
|
*/
'replacers' => [
\Statamic\StaticCaching\Replacers\CsrfTokenReplacer::class,
\Statamic\StaticCaching\Replacers\NoCacheReplacer::class,
],
/*
|--------------------------------------------------------------------------
| Warm Queue
|--------------------------------------------------------------------------
|
| Here you may define the name of the queue that requests will be pushed
| onto when warming the static cache using the static:warm command.
|
*/
'warm_queue' => null,
]; |
To double check this issue, I created a fresh Statamic install. I set the static caching strategy to It turns out the problem does not occur when I delete a page. It properly gives a 404 in the frontend after deletion. However, when I move a page, it's still visible on its old URL. So this narrows the problem down a bit: when moving an entry (= changing its parent entry) the static cache is not properly invalidated. |
Bug description
When moving (= changing parent page) or removing a page, its statically cached version remains intact. So after moving or removing a page, one can still visit its frontend URL and view it.
In case of moving a page, when an editor has the frontend of the page open on its old URL, changes suddenly stop appearing in the frontend of the page after moving it. That's rather confusing. I believe it can also cause duplicate content issues.
In case of deleting a page, it's not ideal if the page is still around in the frontend of the site after it's deleted.
I'd expect getting a 404 in both cases. When an entry is moved or deleted, it would be nice if the corresponding static cache file(s) would automatically be deleted 🙂
I'll be out on holiday for the coming week, so it might take me a while to respond if there are any additional questions.
How to reproduce
For moving pages:
For deleting pages:
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
Runtime (default)
Additional details
No response
The text was updated successfully, but these errors were encountered: