MagicMirror icon indicating copy to clipboard operation
MagicMirror copied to clipboard

The default NewsFeed module does not respect the rss TTL value

Open bootstrap-prime opened this issue 3 years ago • 7 comments

I found a bug in MagicMirror

Browser: Firefox Hardware: Linux, NixOS Node version: v16.15.0 MagicMirror: v2.20.0

Description: The default NewsFeed module does not respect the rss TTL (time-to-live) value. Providers can set this to request that feed readers check every N minutes, which can ease strain on their services. (See xeiaso.net for an example of a provider that sets this ttl value). It would be helpful if MagicMirror supported this.

Also, the default reloadInterval is too high - a more reasonable default would be every 30ish minutes.

bootstrap-prime avatar Jul 19 '22 23:07 bootstrap-prime

you mean too frequent? ('too high', but actually too low, number)

sdetweil avatar Jul 19 '22 23:07 sdetweil

sorry, yes

bootstrap-prime avatar Jul 20 '22 00:07 bootstrap-prime

what do you mean with "support this".

The ttl value is accessible in the module, so we could do something, but what? Should we increase the updateInterval if it is below ttl?

khassel avatar Jul 20 '22 18:07 khassel

Yeah, essentially. I think the best approach would probably be to make reloadInterval an Option(ms) type, (or the js equivalent). if you set reloadInterval, it is whatever you set it to. If reloadInterval is unset, it is the default (which would be bumped up to every 30mins) or the ttl (if present).

bootstrap-prime avatar Jul 21 '22 01:07 bootstrap-prime

reloadInterval is already a configurable option, default 5 mins.

anyone could change it in their config.

it could be overridden by the feed ttl

sdetweil avatar Jul 21 '22 03:07 sdetweil

the above PR uses now ttl for reloadInterval if submitted by the feed (and if < 24h as mentioned in the docs).

The default reloadInterval is not changed, because I think this is not necassary. You can set a reloadInterval globally for the newsfeed module and for each feed (which should be sufficient). Changing the default value would affect all installations which rely on the current defaults.

khassel avatar Jul 21 '22 20:07 khassel

thank you for logging that Feed TTL overrides the config option

sdetweil avatar Jul 21 '22 21:07 sdetweil

fixed in new release v2.21.0, should be closed @bootstrap-prime @MichMich

khassel avatar Oct 01 '22 20:10 khassel