How many cache files?

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
yandr
Registered User
Posts: 25
Joined: Thu Oct 28, 2021 12:51 pm

How many cache files?

Post by yandr »

How many files are in the cache folder of your forum?

The reason I am asking is because my forum generated over 200k files in a few days that are not getting deleted automatically. This is also the file count limit for my web hosting account and it creates a significant problem for me.

Purging the cache every few days will drop the number to around 26k which is normal for my entire website and forum.

The forum has 500k posts but pageviews are less than 300k per month. I am using version 3.3.15 and IIS/MSSQL.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6835
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: How many cache files?

Post by thecoalman »

Windows is reporting 167 files and 100 folders on my local backup.

I don't know if cron task has anything to do with purging cache files but easiest way to tell if it's running is if topic notifications are being sent assuming packet size for email is anything but 0.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
HB
Registered User
Posts: 240
Joined: Mon May 16, 2005 9:30 pm

Re: How many cache files?

Post by HB »

yandr wrote: Sun May 04, 2025 8:44 amThis is also the file count limit for my web hosting account and it creates a significant problem for me.
Assuming you can run memcached on your server, you can skip files entirely. Here's the line in config.php:

Code: Select all

$acm_type = 'phpbb\\cache\\driver\\memcached';
It will be faster and there's no files in the cache directory (they're in memory).
Dan Kehn
yandr
Registered User
Posts: 25
Joined: Thu Oct 28, 2021 12:51 pm

Re: How many cache files?

Post by yandr »

It is just a shared hosting on an Windows server.

So there is no Cron and I don't have the possibility for advanced configurations either.

Why idea why the cache file are not deleted and how many files are usually generated and exist at any point in time?
HB
Registered User
Posts: 240
Joined: Mon May 16, 2005 9:30 pm

Re: How many cache files?

Post by HB »

I assume they're not deleted because the "tidy_cache" cron job isn't running (in /phpbb/cron/task/core/tidy_cache.php).

What is your setting Under ACP > Server Settings > Run periodic tasks from operating system cron? If disabled, the cron job is run via a hidden element in the footer:

Code: Select all

<div>
	<a id="bottom" class="anchor" accesskey="z"></a>
	{% if not S_IS_BOT %}{{ RUN_CRON_TASK }}{% endif %}
</div>
From overall_footer.html. You can check the status of cron jobs with the phpBB CLI: php bin/phpbbcli.php cron:list.
Dan Kehn
yandr
Registered User
Posts: 25
Joined: Thu Oct 28, 2021 12:51 pm

Re: How many cache files?

Post by yandr »

Thank you for this information.

The setting is disabled (as expected I would add). Please note that I am using a shared hosting service and cannot run commands on the server.
HB
Registered User
Posts: 240
Joined: Mon May 16, 2005 9:30 pm

Re: How many cache files?

Post by HB »

You could force the cache to be "tidied" with a short script:

Code: Select all

<?php

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

global $cache;

$cache->tidy();

echo 'Cache tidied<br>';

?>
This may be covering up an underlying problem, but at least you'd know if the cron job could help.
Dan Kehn
yandr
Registered User
Posts: 25
Joined: Thu Oct 28, 2021 12:51 pm

Re: How many cache files?

Post by yandr »

To be honest I was looking for the underlying problem.

I had already created a script that deletes the cache folder (minus the files that need to stay) periodically.

But I was wondering:
  • How many cache files are created 'normally'
  • If the periodic emptying of the cache folder is working for others on an IIS server
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6835
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: How many cache files?

Post by thecoalman »

I don't know what is normal but I already posted what I have, 1000's is not normal.

Does the purge cache button in ACP work?

Run periodic tasks from system cron: should be set to no and the cron task will run without cron job.

Do attachments delete correctly? Upload one then delete it, manually check the files folder to insure it was deleted. If it's getting deleted I would compare the owner/permissions of files folder compared to cache folder.

Check the error log in phpBB's ACP on the maintenance tab. Check your server error logs to see if there is any indication there.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
Stoker 4.0
Registered User
Posts: 1779
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen

Re: How many cache files?

Post by Stoker 4.0 »

Maybe you are running an extension that creates a lot of cache files?
~ The greatest achievement in life is to inspire ~
Regards Stoker
yandr
Registered User
Posts: 25
Joined: Thu Oct 28, 2021 12:51 pm

Re: How many cache files?

Post by yandr »

I would like to thank everyone for their help.

I believe I have found the culprit, which was indeed an extension and more specifically the SEO metadata extension.

I have disabled it and for the time being the number of files has not increased at all. I will monitor the situation for a few days and if it confirmed I will contact the developer of the extension with the findings.
User avatar
Stoker 4.0
Registered User
Posts: 1779
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen

Re: How many cache files?

Post by Stoker 4.0 »

Glad you got it sorted.
Please report it to the extension author so he can take care of it.
~ The greatest achievement in life is to inspire ~
Regards Stoker

Return to “[3.3.x] Support Forum”