Skip to content

defined('CLEANCACHE_HOURS')#5144

Merged
Alkarex merged 2 commits intoFreshRSS:edgefrom
math-GH:cleancache-constant
Mar 4, 2023
Merged

defined('CLEANCACHE_HOURS')#5144
Alkarex merged 2 commits intoFreshRSS:edgefrom
math-GH:cleancache-constant

Conversation

@math-GH
Copy link
Contributor

@math-GH math-GH commented Feb 23, 2023

Closes #4627

now it is possible to config the cache via ./constants.local.php

<?php
	define('CLEANCACHE_HOURS', 240);

default: 720 hours

Changes proposed in this pull request:

  • introduce the constant CLEANCACHE_HOURS

How to test the feature manually:

  1. check the content of the folder ./data/cache
  2. create ./constants.local.php and set the hours
  3. go to the frontend and reload the page (it would help to comment out the condition if (mt_rand(0, 30) === 1) in lib/lib_rss.php)
  4. old cache files are deleted in ./data/cache

Pull request checklist:

  • clear commit messages
  • code manually tested

@math-GH math-GH added the System care Everything related to system care label Feb 23, 2023
@math-GH math-GH added this to the 1.21.0 milestone Feb 23, 2023
@ColonelMoutarde
Copy link
Contributor

hello, Why a constant and not make it customizable?

@Alkarex
Copy link
Member

Alkarex commented Feb 25, 2023

hello, Why a constant and not make it customizable?

While user options are good, having too many gives some clutter and increases complexity, so that should be balanced with the benefits. In this specific case, I think a constant would be a good start, while we think about better default values and behaviours.

@Alkarex Alkarex modified the milestones: 1.21.0, 1.22.0 Feb 25, 2023
@Alkarex Alkarex merged commit a7e1428 into FreshRSS:edge Mar 4, 2023
@math-GH math-GH deleted the cleancache-constant branch March 4, 2023 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

System care Everything related to system care

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ./data/cache with 6700+ files 2+GB

3 participants