Payments are experiencing issues due to temporary restrictions in Russia. If your payment does not go through, please submit a support request.Our support team is available 24/7 — we are always here to help with hosting and server issues.We are now accepting requests for dedicated server rental and colocation services in our data center.Reminder: we recommend enabling backups for additional data protection.A new VPS/VDS lineup with NVMe storage and improved performance is now available.Maintenance work on some servers has been completed. All services are operating normally.
Clearing outdated cache

MODULE FOR 1C-BITRIX

Ten Letters

Clearing outdated cache

The 'Old Cache Cleanup' module automatically removes only outdated cache files on a schedule, freeing disk space without slowing down the site. Fresh cache data remains untouched.

Technical details

Published
3 October 2026
Version
0.3.5
Installed
Fewer than 50 times
Compatible editions
First Site, Start, Standard, Small Business, Business, Online store + CRM
Responsive design
No
Composite support
Yes
Compatible with Sites24
No
Developer
Ten Letters

What this solution does

The 'Old Cache Cleanup' module automatically removes only outdated cache files on a schedule, freeing disk space without slowing down the site. Fresh cache data remains untouched.

Folders /bitrix/cache/, /bitrix/managed_cache/, /bitrix/stack_cache/, /bitrix/html_pages/, and /upload/resize_cache/ grow over time: old cache files accumulate on the disk until manually deleted or removed by a custom script. On large sites, this leads to gigabytes of unnecessary data, slower backups, and hitting hosting quotas.

The solution is implemented as a single module. After installation, the agent automatically finds and deletes only unnecessary files at intervals of several hours. The active cache is preserved, so the site does not lose performance or rebuild pages from scratch as it would after a full reset.

Module capabilities:

Removes cache with expired lifetime. The expiration time is determined directly from the cache file content, not inferred from the modification date. This uses the same mechanism as the standard Bitrix cleanup.

Cleans up the deferred deletion queue: when Bitrix resets tagged cache, it renames directories to the .~N format and places them in a queue. The module completes this cleanup.

The module performs additional cache cleanup based on file age. Each directory has its own threshold in hours: cache, managed_cache, stack_cache, html_pages (including composite cache), upload/resize_cache, upload/tmp. The mode is disabled by default and must be enabled separately for each directory.

The script does not overload the server: a limited number of files are deleted within a set time per run, with the remainder processed in subsequent runs. Parallel execution is prevented by a locking mechanism.

Results are displayed in a desktop gadget showing the number of deleted files, freed space, and the time until the next run. A "Run Now" button allows immediate execution without page reload.

Every run is logged in the Bitrix event log.

Cleanup can be triggered via cron or manually by running the command php bitrix/modules/tenletters.oldcache/cli/clean.php.

Developers can use the OnBeforeOldCacheClean and OnAfterOldCacheClean events: the former allows cancellation of the run, while the latter provides execution statistics.

Security

The module never deletes all files indiscriminately; only files officially recognized as obsolete are removed.

The module deletes only files and empty directories within the specified cache cleaning folders. Symbolic links inside them are not processed. Cache files are removed by expiration time only if they physically reside in the cache, managed_cache, or stack_cache directories.

Settings and manual execution are available exclusively to administrators. AJAX requests are protected by a CSRF token.

The module does not create database tables or modify core files. When the module is removed, the agent, settings, and gadget copy are automatically uninstalled.

Quick Setup

After installation, the module automatically registers the agent with a 6-hour interval. Expiration-based cleaning is enabled immediately. If needed, you can open the settings to activate age-based cleaning for specific directories and adjust the interval and limits.

Frequently Asked Questions

Will the module delete necessary cache? No. Expiration-based cleaning removes only files whose validity period has expired. Age-based cleaning (disabled by default) may also remove active cache older than the set threshold. Bitrix will rebuild it upon the next request, so the first page loads may be slightly slower.

How often should it run? By default, once every 6 hours. The minimum interval is 300 seconds; more frequent execution is usually unnecessary.

If the cache has accumulated to an excessive volume, increase the file limit per run or execute the manual cleanup several times in succession. The actual constraint on execution duration is the time limit; the file limit counter tracks only successfully deleted files.

To disable automatic cleanup without removing the module, clear the 'Module enabled' checkbox. The agent and CLI script will then stop running, but all settings will be preserved and the option for manual execution will remain available.

Information about the module's actions can be found in the gadget and in the event log. To view this, navigate to 'Settings → Event log' and apply a filter for the tenletters.oldcache module. A link to the log is available directly on the settings page.

General iT can connect “Clearing outdated cache”, install and configure the module, and make sure the integration works correctly.

USER EXPERIENCE

Solution reviews

How does this solution work in a real project? Share your experience and help others choose.

Be the first to share your experience

There are no reviews of this solution on git.ru yet. Tell us what worked well and what could be improved.

Verified purchaseAdd a key if you wish. A verified review gets a badge, priority placement and more rating weight.

Open to every clientJust sign in to your account. A key is optional; all reviews are moderated.

YOUR EXPERIENCE MATTERS

Your review

YOUR PROJECT INFRASTRUCTURE

A home for your website

BEFORE YOU ORDER

Let’s go through the details.

Is installation free?
The solution itself is free. Installation, configuration and customisation services are agreed separately. A compatible platform and an appropriate platform licence are required.
How do I check compatibility?
Compare the supported editions and solution version in the technical details with your project. Before installing on a live website, we recommend making a backup and checking the solution in a test environment.
Can you help with implementation?
We can help install the module, check its settings and verify how it works in your project. Compatibility with other customisations and the scope of work are assessed before we begin.

GENERAL iT

Let’s discuss your project

Получатель: ООО «Дженерал Ай Ти Рус»

1C-BITRIX

Install solution

Enter a domain with or without https://. The installer will open in your website control panel in a new tab.

Solution screenshots

Solution screenshot