2022.2

Table Of Contents
Optimizing a template
Thistopicdescribessomewaystooptimizeatemplateinordertospeeduptheoutputprocess.
However,thetemplateitselfisnottheonlyfactortobetakenintoaccount.Theserverconfigurationand
hardwareconfigurationhaveaninfluenceontheoutputspeedaswell.Foradviceonservercon-
figurationandhardwareconfiguration,see"Performanceconsiderations"onpage23.
Scripts
Intheprocessofoutputgeneration,theexecutionofscriptsmaytakeupmoretimethannecessary.
Here'swhatyoucandotoshortenthattime.
l
Use efficient selectors.Usingverypreciseselectorsinscriptswillbemuchfasterthanusinga
textselector,especiallyonlargedocuments.See"UseanIDorclassasselector"onpage821.
l
Optimize your scripts.Customscriptswithnon-optimizedloopsandunnecessaryDOMmanip-
ulationscanslowdownContentCreation.UsetheDesigner'stestfacilitiestofindoutwhich
scriptscanbeimproved(see"Testingscripts"onpage816and"Optimizingscripts"on
page820).
l
Only run the necessary scripts.NormallytheDesignerwillrunallscriptsforeachandevery
recordandsection.YoucansavetimeintheprocessofContentCreationbyorganizingscriptsin
foldersandsettingtheirexecutionscopeorevendisablingthem(see"Managingscripts"on
page814).NotethatloadingaJavaScriptlibraryisgenerallyveryfastandisonlydoneoncefor
therecordset.
l
Use a fast network and internet connectionoravoidloadingexternalorinternetresources.
Usingimages,JavaScriptorCSSresourceslocatedonaslownetworkoronaslowinternetcon-
nectionwillobviouslyleadtoalossofspeed.Whilewedoourbestforcaching,adocumentwith
5,000recordswhichqueriesapagethattakes1secondtoreturnadifferentimageeachtimewill,
naturally,slowoutputgenerationdownbyupto83minutes.
l
Makesuretouseoptimized graphic resources.Forinstance,avoidusingimageswithtrans-
parencywherenotransparencyisneeded.
Images
l
Makesuretouseoptimized graphic resources.Forinstance,avoidusingimageswithtrans-
parencywherenotransparencyisneeded.
l
Whenatemplatethatcontainslotsofimagesismergedwithalargerecordset,themanyfile
requestsmayslowdowntheprocessofoutputgeneration.Onesolutionistocombinetheimages
intoasingleimagefile(an'imagesprite')anddisplaythepartthatholdstheimage.Thisreduces
thenumberoffilerequestsandcanimprovetheoutputspeedsignificantly.
Page 1351