How to change site property value in UI

How to change site property value in UI

  

Hi,

    How to change site property value dynamically in UI.

Solution

Hi,

The same way you do with any other variable or session.variable.
But it is considered bad practice to do it and you should avoid doing this.

Cheers,
Eduardo Jauch

Solution

Added to that, the reason why it's considered bad practice is that site properties are cached (so when using them the Platform doesn't need to fetch them from the database each time), but when you assign them a new value, they are written to the database and the cache is refreshed, which gives a (relatively) huge performance penalty.

Kilian Hekhuis wrote:

Added to that, the reason why it's considered bad practice is that site properties are cached (so when using them the Platform doesn't need to fetch them from the database each time), but when you assign them a new value, they are written to the database and the cache is refreshed, which gives a (relatively) huge performance penalty.


And what if the assigned value is the same as the previous value? Will the cache be cleared in this situation?

Hi Caio,

I'm not sure whether such an optimization is built in. But the general advise stands: don't assign values to site-properties, except via Service Center or another configuration app.