500 times - that's a lot! Maybe you could run it once offline, and save the result as HTML?
Just an idea. On Thu, Aug 25, 2016 at 10:35 PM, Donavon <d...@mycopanet.com> wrote: > I have a loop that is calling Execute() to load a EMBPERL page as a > template. This template sets up and contains a bootstrap modal and some > javascript . The page I'm using as a test calls the template at least 500x. > > This is really slowing down the loading of the page for the client. > > Are there any suggestion for optimizing and / or speeding this up? > > Thank You, > ~Donavon > djler...@yahoo.com > > > [$ while ( ($ID) = $sth->fetchrow) $] > > [- > %opts = (); $opts{ID} = > $ID; > $opts{title} = "Modal Title"; > $opts{footer} = "Modal Footer"; > $opts{frameSrc} = "file.epl"; > $opts{linkText} = 'Click Me to Open Modal'; > Execute("template.epl", \%opts); > -] > > [$ endwhile $] > > > *--- **template.epl* > > [- > (%param) = %{$param[0]}; > -] > <!-- trigger modal --> > <a id = "trigger_[+ $param{ID} +]" > title = "[+ $param{title} +]" > alt = "[+ $param{title} +]" > style = "cursor:pointer;" > > > [- $escmode = 0; -][+ $param{linkText} +][- $escmode = 1; -] > </a> > <script> > > > $('#trigger_[+ $param{ID} +]').click(function(){ > var frameSrc = "[- $escmode = 0; -][+ $param{frameSrc} +][- $escmode = 1; > -]"; > > $('#iframe_[+ $param{ID} +]').attr("src",frameSrc); > > $('#modal_[+ $param{ID} +]').modal({show:true}) > }); > > </script> > > > <!-- modal --> > <div class="modal fade pageWidth" id="modal_[+ $param{ID} +]" tabindex="-1" > role="dialog" aria-labelledby="myModalLabel"> > <div class="modal-dialog pageWidth" role="document"> > <div class="modal-content"> > <div class="modal-header"> > <button type="button" class="close" data-dismiss="modal" > aria-label="Close"><span aria-hidden="true">×</span></button> > <h4 class="modal-title" id="myModalLabel"> > [+ $param{title} +] > </h4> > </div> > <div class="modal-body"> > <iframe id="iframe_[+ $param{ID} +]" src="" frameborder="0" > height="400" class="pageFull"></iframe> > </div> > <div class="modal-footer"> > [+ $param{footer} +] <button type="button" class="btn btn-default" > data-dismiss="modal">Close</button> > </div> > </div> > </div> > </div> > > > >