Work Unit and load time query

Hi, just a query on work units and load time.

Lets say I have 1 User db and 1 Company db (with a co name field). And also a reusable element header which is common throughout.

When the user logs in we know ‘current user’s /company’s/ co name’ through the relationship.

I have 2 possible ways of calling the company name;

  1. when the header loads (on page load) the company name is stored in a State (of the header) called say ‘coName’. As the header is common, this State can be called at any point in the app.

  2. or I can call ‘current user’s /company’s/ co name’.

Both work equally well so my questions is: which method uses less work units and which method would load faster or are both methods equal?

I assume the common header has to load each time a new page is selected or a refresh is used in a workflow.

What would be good is to be able to set certain common States at user login rather than resetting them each time the header loads.

Thanks for any help…

“Current page thing” is faster than setting state on page load. Secondly if you were to share URL’s to anyone, current page thing would work wonderfully for SEO (page title, image etc), while for state it doesn’t work.

That’s brilliant info. Ok I use a lot of states for display but I’ll current user for faster loads.

Thanks.

This topic was automatically closed after 66 days. New replies are no longer allowed.