statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
4.07k stars 530 forks source link

Static Page Cache number too high? #10757

Closed stephenmeehanuk closed 2 months ago

stephenmeehanuk commented 2 months ago

Bug description

Hi

I've been experiencing issues with my queues not running.

While looking around, trying to figure out what the issue is, I spotted the static page cache is 9540 pages?

This is way too high, the site isn't that big.

I wonder if this could be the reason why the queue keeps failing?

Do you know of any reason why the static page cache would inflate like this?

Screenshot 2024-09-04 at 10 01 04

How to reproduce

Difficult to know how to reproduce, sorry.

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.20.0
PHP Version: 8.3.10
Composer Version: 2.7.8
Environment: production
Debug Mode: OFF
URL: website.com
Maintenance Mode: OFF
Timezone: America/New_York
Locale: en

Cache
Config: CACHED
Events: NOT CACHED
Routes: CACHED
Views: CACHED

Drivers
Broadcasting: pusher
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: redis
Session: redis

Livewire
Livewire: v3.5.4

Statamic
Addons: 5
Sites: 1
Stache Watcher: Disabled
Static Caching: half
Version: 5.22.0 PRO

Statamic Addons
jonassiewertsen/statamic-jobs: 1.5.0
jonassiewertsen/statamic-live-search: 2.1.1
jonassiewertsen/statamic-livewire: 3.6.0
statamic/collaboration: 1.0.0
visuellverstehen/statamic-anchor-navigation: 1.0.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

stephenmeehanuk commented 2 months ago

Since posting the number of pages is continuing to increase? It's on 9579 now.

Screenshot 2024-09-04 at 10 31 07

Just refreshed again it's on 9582. The site doesn't have that many pages?

duncanmcclean commented 2 months ago

It could be related to query parameters.

When someone visits a page with unique query parameters, Statamic will treat that as a new page. You could try enabling the ignore_query_strings option in the config file to see if that helps.

duncanmcclean commented 2 months ago

I've been experiencing issues with my queues not running.

Also, I don't think this will be related to your queues not running. I think that'll likely be a different issue.

stephenmeehanuk commented 2 months ago

It could be related to query parameters.

When someone visits a page with unique query parameters, Statamic will treat that as a new page. You could try enabling the ignore_query_strings option in the config file to see if that helps.

I'll give this a go, I didn't know about that setting.

jasonvarga commented 2 months ago

And/or it could be 404 pages that get cached. You may want to consider the share_errors config. See https://github.com/statamic/cms/pull/10294

duncanmcclean commented 2 months ago

If either/both of those options don't work, let us know and we can re-open this issue.