Persistence: "don't persist" alternative to override default strategy?

I’m using MySQL persistence and have default = everyChange
along with * : strategy = everyChange, everyDay, restoreOnStartup in my items section.

I’d like to exclude a number of items from being persisted, as they are just noise – a few are formatted string versions of other items (for example, I present two temperature readings in one sitemap item by concatenating them in a rule that fires when either changes), and some are “last updated” timestamps – none of which have any long-term value (and now that I’m using persistence, I may be able to retire the “last updated” items anyway).

So, ideally, I’d like to do something like

* : strategy = everyChange, everyDay, restoreOnStartup
gDontPersist*: strategy = never

Which brings up two questions –

  1. Is it possible to define an explicit strategy for “never”? Closest I’m coming up with so far would be 1st of every month, although I’m thinking of experimenting with some invalid constructs like */61 for the minute field to see if I can back into “never”.
  2. If an item qualifies for multiple strategies, does the first or last take precedence? Or both?

Put all your items that you want to persist in a group and do persist this group.
On your questions, 1.) NO
2.) I don’t know.

it’s incremental, meaning you’ll get all strategies in which the item falls. That’s why you will never have an “never” strategy. You must do as Jürgen proposed: configure items or groups and put them in a strategy - and leave those out, you don’t want to persist.

Example way to do what opus and binderth suggest:


Thanks. Since I’m only currently using one persistence service, I’ve created one group, gPersist, and added it to all of the relevant items and switched my item selection in mysql.persist from * to gPersist*.

1 Like