Developer forum

Forum » CMS - Standard features » Avoid having sql executed from item dropdown?

Avoid having sql executed from item dropdown?

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

We are often using the future in Dynamicweb to make dropdowns in our items based on sql, but it seems to come with a performance penalty as the sql statement is executed every time the value from the item is used, even though we are just requiring the value with GetValue (and not GetList where I better understand the statement is executed despite caching would have been fine :-)).

The value is stored directly in the database so I cannot see the reason why the statement is executed when just requesting the value??

 

Best regards, Anders


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi Anders,

The dropdown options based on sql should be cached for 5 minutes, but this is not the case with your solution?
I assume that you are using view models in your templates. In recent versions there is a GetRawValue method. Can you try that instead?

Best regards,
Morten

Votes for this answer: 1
 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Morten,

 

Thank you very much! I can see that GetRawValue actually does the trick, and at the same time I can see that caching is not working (testet in 9.12.7).

 

Best regards, Anders

 

You must be logged in to post in the forum