2022.2

Table Of Contents
Thereareafewadvantagestousingremoteresources:
l
Theseresourcesarenotservedbyyourserver,savingonspace,bandwidthandprocessing.
l
UsingapopularCDNtakesadvantageofcaching-aclienthavingvisitedanotherwebsiteusing
thatsameCDNwillhavethefileincacheandnotre-downloadit,makingforfasterloadtimesfor
theclient.
ToaddaremoteJavaScript:
1. Right-clicktheJavaScriptfolderontheResourcespane,andclickNew Remote JavaScript.
2. EnteranameforthefileasitappearsintheJavaScriptresources.Forbettermanagement,it's
besttousethesamefilenameastheremoteresource.
3. EntertheURLfortheremoteresource.ThismustbeafullURL,includingthehttp://orhttps://pre-
fix,domainname,pathandfilename.
4. Optionally,checkdeferorasynctoaddtheasyncordeferattributetothe<link>elementinthe
<head>ofthesegment.
Deferpostponestheexecutionofthescriptuntilthepagehasfinishedparsing.Thisattributeis
requiredbyAPIslikeGoogleMaps.
Whenasyncischecked,thescriptexecutesasynchronouslywiththerestofthepage(whilethe
pagecontinuestheparsing).
Whenneitheroptionischecked,thescriptisfetchedandexecutedimmediately,whilethepars-
ingofthepageispaused.
5. Optionally,foraCaptureOnTheGoForm,youcancheckUse cached Capture OnTheGo
resource,topreventdownloadingaremoteJavaScriptfileagainifithasbeendownloaded
before.Thefileshouldbeavailableonapubliclyaccessiblelocation,forexample:afolderloc-
ationonacorporatewebsite,hostedbyaCDN(ContentDeliveryNetwork)orsharedviaaWork-
flowprocess.
Note: InWorkflow,whenusingtheCreateWebContenttask,checktheEmbed All Resources
optiontodownloadandembedallremoteresources.(SeeWorkflowHelp:CreateWebContent.)
Tip: Afteraddingtheremotefile,youmayright-clickitandselectDownload Resource.This
allowsyoutomaintainacentralfile,fromwhichyoucanquicklydownloadacopytoyourtem-
platewithouthavingtocopy&paste.
Notethatalocalcopyofaremoteresourceisasnapshot;itisnotautomaticallykeptinsyncwith
itsremotecontent.Youcandownloadtheremoteresourceagaintooverwritethelocalcopywith
updatedcontent.Ifyoudon'twantalocalcopytobeoverwrittenyoushouldrenameitbefore
downloadingtheremoteresourceagain.
Page 514