Jump to content

Topic on Extension talk:SemanticUpdateOnPurge

Is there a way to auto-purge after saving?

2
Planetenxin (talkcontribs)

This is really a great extension. I was wondering if there is a way to trigger the semantic update without having the user to purge the page manually? Something like purgeAfterSave...

Story: A wiki to manage tasks. Each task has an estimated effort. Ability to add comments. With each comment (added as Semantic Internal Object) 'hours worked' can be added. Now I need to summarize the hours worked for each task and assign the total to a property 'Hours Worked' for reuse on a dashboard. With SemanticUpdateOnPurge and a manually triggered purge, the Hours Worked get updated. It would be nice to have data updated without user interaction.

Danwe (talkcontribs)

Which version of SMW do you have in use? I think in some newer version, Jeroen added the feature that the articles cache will be invalidated right after the first rendering after the save, which basically triggers an immediate purge. So far I was not able to confirm that behavior though. If that doesn't work for you, it shouldn't be much of a problem to write an extension that invalidates the cache after a save. See Title::invalidateCache(). Alternatively, this sounds like you could also use my extension Extension:Variables to calculate the hours worked right throughout the template calls and then simply display them wherever you want with #var or even #var_final (in case you want to display it in an info box on top for example). This would probably take some good load from the server.

Reply to "Is there a way to auto-purge after saving?"