How to change site property value in UI

Hi,

    How to change site property value dynamically in UI.

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

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.

As the site property values are cached, ie, while fetching, it is doing so from cache. Is  there are way in which we can refresh the cache, say if we have build a screen for site properties ( a replica of service center) just to encrypt the values.

Hi Debasis,

First, please don't add new questions to existing topics, especially when they're almost a year old. For one, it'll pollute the original question + answers, and secondly, no-one will read your new question since when the topic is already marked as "Solved", like in this case. New topics get far more attention.

That said, I already answered your question in my post above. So reading the answers can be helpful as well, and would've prevented you from asking your question in the first place. I'm now closing this topic to prevent further discussion.