diff options
author | Mario <mario@mariovavti.com> | 2019-11-25 21:50:03 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-11-25 21:50:03 +0100 |
commit | 697fbf33c55ea6439b15eaa543366acdbd0b0d00 (patch) | |
tree | 8e3c393a518656b1349e43205eed2554814c2924 | |
parent | 38de059156f9a6ec63727d47a96d1b15e96e3b47 (diff) | |
parent | 901785663edc7045c66d9393432a18bb376436bb (diff) | |
download | volse-hubzilla-697fbf33c55ea6439b15eaa543366acdbd0b0d00.tar.gz volse-hubzilla-697fbf33c55ea6439b15eaa543366acdbd0b0d00.tar.bz2 volse-hubzilla-697fbf33c55ea6439b15eaa543366acdbd0b0d00.zip |
Merge branch 'dev' into 'dev'
Fix once cached embedded content is used and stored forever
See merge request hubzilla/core!1790
-rw-r--r-- | Zotlabs/Daemon/Cron_daily.php | 5 | ||||
-rw-r--r-- | Zotlabs/Lib/Cache.php | 13 | ||||
-rw-r--r-- | doc/hidden_configs.bb | 1 |
3 files changed, 10 insertions, 9 deletions
diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php index b41625963..452ef45f1 100644 --- a/Zotlabs/Daemon/Cron_daily.php +++ b/Zotlabs/Daemon/Cron_daily.php @@ -50,6 +50,11 @@ class Cron_daily { dbesc('sse_id.%') ); + // Clean up emdedded content cache + q("DELETE FROM cache WHERE updated < %s - INTERVAL %s", + db_utcnow(), + db_quoteinterval(get_config('system','active_expire_days', '30') . ' DAY') + ); //update statistics in config require_once('include/statistics_fns.php'); diff --git a/Zotlabs/Lib/Cache.php b/Zotlabs/Lib/Cache.php index cea075659..878201a42 100644 --- a/Zotlabs/Lib/Cache.php +++ b/Zotlabs/Lib/Cache.php @@ -11,8 +11,10 @@ class Cache { $hash = hash('whirlpool',$key); - $r = q("SELECT v FROM cache WHERE k = '%s' limit 1", - dbesc($hash) + $r = q("SELECT v FROM cache WHERE k = '%s' AND updated > %s - INTERVAL %s LIMIT 1", + dbesc($hash), + db_utcnow(), + db_quoteinterval(get_config('system','object_cache_days', '30') . ' DAY') ); if ($r) @@ -40,12 +42,5 @@ class Cache { dbesc(datetime_convert())); } } - - - public static function clear() { - q("DELETE FROM cache WHERE updated < '%s'", - dbesc(datetime_convert('UTC','UTC',"now - 30 days"))); - } - } diff --git a/doc/hidden_configs.bb b/doc/hidden_configs.bb index 361aa94ba..37c2a4cb6 100644 --- a/doc/hidden_configs.bb +++ b/doc/hidden_configs.bb @@ -73,6 +73,7 @@ Options are: [*= system.max_tagged_forums ] Spam prevention. Limits the number of tagged forums which are recognised in any post. Default is 2. Only the first 'n' tags will be delivered as forums, the others will not cause any delivery. [*= system.minimum_feedcheck_minutes ] The minimum interval between polling RSS feeds. If this is lower than the cron interval, feeds will be polled with each cronjob. Defaults to 60 if not set. The site setting can also be over-ridden on a channel by channel basis by a service class setting aptly named 'minimum_feedcheck_minutes'. [*= system.no_age_restriction ] Do not restrict registration to people over the age of 13. This carries legal responsibilities in many countries to require that age be provided and to block all personal information from minors, so please check your local laws before changing. + [*= system.object_cache_days] Set how long is cached embedded content can be used without refetching. Default is 30 days. [*= system.openssl_conf_file ] Specify a file containing OpenSSL configuration. Needed in some Windows installations to locate the openssl configuration file on the system. Read the code first. If you can't read the code, don't play with it. [*= system.openssl_encrypt ] Use openssl encryption engine, default is false (uses mcrypt for AES encryption) [*= system.optimize_items ] Runs optimise_table during some tasks to keep your database nice and defragmented. This comes at a performance cost while the operations are running, but also keeps things a bit faster while it's not. There also exist CLI utilities for performing this operation, which you may prefer, especially if you're a large site. |