Developer forum

Forum » Templates » Performance hit when using many includes?

Performance hit when using many includes?

Martin Nielsen
Reply
Hi DW,

I have a "simple" question.

When i'm building a website in Dynamicweb, is there a problem in using includes a lot?
I thinking about using multiple includes inside a product loop, is that a problem?

Does DW create a cached template the first time it's used, so i dont have to worry much about it?

Regards
 Martin

Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer
Hi Martin

When Dynamicweb loads a template from disk, it takes a look at all includes using the @Include tag. They are then loaded in the original template, and the merged template is then cached in memory with priority normal.

So it should be ok to do multiple includes.

If you do an include inside a loop, the include is performed only once - when the template loads. Handling the loop is done later in the rendering.

Votes for this answer: 0

 

You must be logged in to post in the forum