[WMDE-Fundraising] Add route for clearing template cache
Closed, ResolvedPublic3 Story Points

Description

The old application had a purge parameter to clear the template cache. The new application should have a route that does this, otherwise wiki changes are not reflected in the application.

Related Objects

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 4 2016, 10:14 AM

So when an edit on the wiki occurs, it will do a push notification to the app to invalidate the cache?

Does it make sense to also rebuild the cache during this action?

A request from the wiki to the app would be the deluxe version, but would require changes to the ContentStaging extension and make it a bit slower. This task is only about the FundraisingFrontend side.

Cache warming would be nice, however it would need some registry of used templates. Twig only provides a very rudimentary cache interface with no such registry. Implementing this would be a separate project and would bump up the complexity considerably. So I'd like to postpone that until we run into problems.

So what would call this purge route? And do we want to somehow prevent regular users from calling this?

I'd call it /purge-cache.

For security you could store the date of the last purge somewhere and create a class that uses the MedaiWiki API to get a list of recently changed pages and compare the newest page to the date of the last purge.

The old application did not have any protection except for chekcing for a very short, fixed string (I won't disclose here), so the API-based protection feature might be a separate feature in "New Stuff". To have a least some protection you could check for a secret parameter than can be configured in the config file.

Let's start with the secret in the config approach then.

Tobi_WMDE_SW closed this task as Resolved.Apr 7 2017, 11:25 AM
Tobi_WMDE_SW claimed this task.
Restricted Application added a project: WMDE-Fun-Team. · View Herald TranscriptApr 7 2017, 11:25 AM