Community > Answers
29 views

Live HTML datacontext redundant data?

At my clients intranet website a Live HTML v ersion 2.00.04 (with source code) has been like a content backbone of the site during a couple of years. Since we (the system architect and I) have been deploying a strategy of having lots of Live HTML module instances on each page of the site we have considering the excessive page load time been forced to look into the code in order to get rid of redundant calls to DataContext in the Live Html controller class that causes an immense and apparently redundant dataflow with the below sql query being executed at least once for each module instance (dependent upon embedded modules) in view mode and several times (because of the embedded modules feature) for each module instance in Edit mode:
'
select html.* from dbo.livehtml_content html inner join(select max(html.Version) as [Version], Portalid, Moduleid from dbo.LiveHtml_Content as html group by html.Portalid, html.Moduleid) htmlgrp on htmlgrp.ModuleID = html.ModuleID and htmlgrp.PortalID = html.PortalID and htmlgrp.Version = html.version 
'

we have replaced the above query with this one in when in View mode:
'
select html.ModuleId, html.Content, html.EmbeddedModule from dbo.livehtml_content html inner join(select max(html.Version) as [Version], Portalid, Moduleid 
from dbo.LiveHtml_Content as html group by html.Portalid, html.Moduleid) htmlgrp on htmlgrp.ModuleID = html.ModuleID 
and htmlgrp.PortalID = html.PortalID and htmlgrp.Version = html.version 
where html.ModuleID = @0", ModuleId
'
And it works conveniently reducing load time to at least twice as fast.
It is difficult to understand - at least when in view mode - why you would need the entire collection of Live html modules just to display the current module instance. We have checked the latest version of Live HTML that still deploys datacontext in form of the original sql query for each module instance in view mode.
I hope someone will find the time for a brief answer to why getting a collection of all Live Html modules on the entire site each time a specific module is loaded has been found necessary?

mio mio
asked 11/21/2019 11:35
Add Comment
Last Activity 11/21/2019 20:51

1 Answer(s)

  • answered 11/21/2019 20:51
    Mandeep Singh
Add an Answer