Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Justin James
MVP
1419
Views
18
Comments
Solved
How do Site Properties work "under the hood"?
Question
I am curious about the way Site Properties (and Session Properties too) work "under the hood".
Specifically, do they get read from the database:
* Once per page view
* Every time they are accessed
* Once when IIS is started
In other words, if I have many Actions on the same page referring to the same Site Property, is there a performance advantage to using a Site Property instead of storing that setting in the database?
Thanks!
J.Ja
João Rosado
Staff
Solution
Hi,
Site properties are cached in the applications after the first access. You can notice them listed in the
ESpaceInvalidateCache action help page
. Also, since version 7.0, changing a value on a site property at runtime automatically triggers a ESpaceInvalidateCache at the end of the request. This is also explained in the
Site properties help page
.
Session variables are stored in the session database (you guessed wrong :P, no viewstate). This is explained in the
Session Variables help page
as well.
They are read from the session database when accessed and written in the end of the request if needed.
For performance reasons reads and writes are done per eSpace. So if at least 1 variable from an eSpace is necessary in a request, then all the variables defined in that eSpace will be fetched in bulk.
Regards,
João Rosado
See solution in context
J.
MVP
Yup, I like to know that too.
I have some educated guesses (session-variables == viewstate/controlstate in .net, and site-properties are application-state variables in .net)
João Rosado
Staff
Solution
Hi,
Site properties are cached in the applications after the first access. You can notice them listed in the
ESpaceInvalidateCache action help page
. Also, since version 7.0, changing a value on a site property at runtime automatically triggers a ESpaceInvalidateCache at the end of the request. This is also explained in the
Site properties help page
.
Session variables are stored in the session database (you guessed wrong :P, no viewstate). This is explained in the
Session Variables help page
as well.
They are read from the session database when accessed and written in the end of the request if needed.
For performance reasons reads and writes are done per eSpace. So if at least 1 variable from an eSpace is necessary in a request, then all the variables defined in that eSpace will be fetched in bulk.
Regards,
João Rosado
Justin James
MVP
Joao -
Fantastic information, thanks! Just what I hoped to hear.
J.Ja
J.
MVP
:thumbsup:
excellent info!
João Melo
MVP
Great
André Vieira
Staff
Hi all,
Now I'm the curious one :)
João's reply basically uses public available information on the online reference.
My curiosity centers on 'Why didn't you reach it?' and I'd like your help to figure it out.
Please get back and choose from the following (one or more):
Didn't occur to me that this info would be available on the reference help.
Didn't look into the reference help 'cause the information there is not accurate or updated.
I gave up on looking into the reference help long time ago 'cause it is too hard to read/search/understand.
Didn't search for it in the community 'cause I never find anything anyhow.
Didn't search for it in the community 'cause I didn't know I could search the community.
I searched on Google/Bing/Yahoo but didn't get good results...
Other.... (add your own reasoning)
Thank you very much!
With your help we will make a better product and community!
PS: If you prefer you can PM me.
Cheers
1 reply
19 Sep 2014
Show thread
Hide thread
Hugo Ferreira
André Vieira
wrote:
João's reply basically uses public available information on the online reference.
My curiosity centers on 'Why didn't you reach it?' and I'd like your help to figure it out.
Funny you mention this, as I was just now searching &
skimming
for the information about how site properties are stored internally.
In this particular case, my first approach was precisely to search in the online help pages, and I even passed by the page “About Site Properties” but dismissed it as irrelevant for my query… remember, I
skimming
for info, not
reading
back-to-back!
In that page the information João mentions is under the header “Multi-Tenant Applications”… I don’t care about multi-tenant as it doesn’t apply to my project, so I moved on.
Searching the community shows me a 'How do Site Properties work "under the hood"?' in the first page, which is
exactly
what I’m looking for.
In the online help page about Session Variables, the database in a header called “User-defined Session Variables”, in a paragraph that starts by explaning they “should be used with care since they can affect the scalability”…
Just because it’s written, does’t mean it’s in a place that’s easy to find :)
Cheers
--
Hugo
João Melo
MVP
In fact this question was in my 'doubts list'. When I received the Mail Digest with the title 'How do Site Properties work "under the hood"?' I came and found the usefull Joao's reply.
J.
MVP
Hi,
1. I rarely get the right info on the reference help.
2. when i look in service studio help, i get the following result:
https://www.outsystems.com/community/CommunitySearch.aspx?SearchQuery=site%20proprties&Index=0&Collection=3&WithAllWords=&ExactPhrase=&WithoutWords=&FileType=0&FilterResults=1&CollectionStr=
when I search on the community i get too many results and also very old. I never know which is latest and which is too old
André Vieira
Staff
Hi Joost,
You actually have a typo in your search. Did you miss the 'Did you mean' suggestion?
Do you actually use the tabs to filter results from the Reference Help?
1 reply
07 Mar 2014
Show thread
Hide thread
J.
MVP
André Vieira
wrote:
Hi Joost,
You actually have a typo in your search. Did you miss the 'Did you mean' suggestion?
Do you actually use the tabs to filter results from the Reference Help?
Sorry I was in a hurry, but the focus is not with "did you mean"
I just spot there are no results and that is it.
Then I just hit search again, because it is prefilled (with what I expect is the new suggestion)
(Why do I have the feeling I am doing cheap-live with you ;) )
The answer your 2nd question:
I sometimes use the tabs, yes
But I still miss timestamps on the forums-results, because I want to know if the discussion is relevant.
(everything that is older than 2012 is prolly outdated with the improvements of SS)
Kilian Hekhuis
MVP
One thing that isn't mentioned, is that when the site-property is in a producer eSpace, the consumer's cash is not refreshed. A redeploy of the consumer is necessary in that case. (This may have changed in v8, I didn't check recently).
João Rosado
Staff
Hi Killian,
Thats actually not correct.
Before 7.0 you needed to call the invalidate cache action manually after changing the site property. On 7.0+ the cache invalidation of both producers and consumers regarding the affected site properties is done automatically on the end of the request, if necessary.
On what version were you experiencing that behavior?
Regards,
João Rosado
Kilian Hekhuis
MVP
Hi João,
We recently upgraded from 6 to 8, so I that was why I mentioned not being sure for 8 (should've mentioned 7 as well). However, I'm absolutely sure that that on 6, the cache for the eSpace owning the site properties is refreshed (perhaps even on 5?).
Justin James
MVP
I too have had issues not seeing the dates on the posts... a lot of information is outdated, or no longer relevant, because the post was made in version 4. :(
J.Ja
André Vieira
Staff
Hi Hugo,
Thank you for your feedback. Hopefully we will improve this in the future and make your experience searching for information much better. Please keep the feedback coming!
Cheers
Tiago Neves
Hi,
I've just found this post after João Rosado's help in directing me here.
So, changing a value on a site property at runtime: it automatically triggers a ESpaceInvalidateCache at the end of the request, of both producers and consumers regarding the affected site properties. This means all consumer eSpaces, if more than one or just the one Consumer that changes the site property?
Regarding André Vieira's remarks, I must say this is not mentioned in the Help (which I have read carefully).
What it says in the Help (
https://www.outsystems.com/help/servicestudio/9.0/default.htm#Language_Reference/About_Site_Properties.htm
) is that "... whenever the cache is invalidated, all the site properties are also re-evaluated." under the title "Multi-Tenant Applications" - but doesn't mention how the cache is invalidated: if it's automatically or by explicitly using ESpaceInvalidateCache Action.
João Rosado
Staff
All consumers are invalidated.
If that is not the behavior that you are experiencing, please make a solution example and we will take a look at it.
Regards,
João Rosado
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...