As far as I know, they are coming from EPiServer Find, and are being put there as required client resources. They are used for the tracking functionality in Find.
Per Magne is correct they are inserted on the page if tracking is enabled in Find to be able to track clicks in the search results.
/Marcus
Is is possible to gzip and compress the files from EPiServer? I would also like to be able to add asyc or defer to them as I am able with other externl scripts.
Bump!
What Eric says...
Google considers these 2 scripts to be render-blocking, which decreases performance and may ultimately lead to worse ranking within Googles search results.
(Googles documentation: https://developers.google.com/speed/docs/insights/BlockingJS)
Cheers
Reinder
Hello Reinder
Its possible to customise how these scripts are loaded:
David
Thanks David,
I believe I've seen that page before, however it does not provide a way to specify attributes like 'async' or 'defer'.
And Eric is in the comments there as well, asking the same thing as he does above :)
Hello Reinder
If you really want to customise how the scripts are rendered then you can create a custom version of the RequiredClientResources method found in EPiServer.Framework.Web.Mvc.Html.ClientResourceExtensions. This ultimately calls the Render method of EPiServer.Framework.Web.Resources.ClientResources which you will also need to provide a customised implementation to add the async attribute.
However it should be noted that it looks like the Find external scripts need to be loaded before the inline Find configuration script so if you go down this approach you should be careful about the order the JS is loaded. So if you ended up with the example below Find may not be configured correctly:
<script type="text/javascript" src="https://dl.episerver.net/12.2.0/epi-util/native.history.js" aysnc></script> <script type="text/javascript" src="https://dl.episerver.net/12.2.0/epi-util/find.js" aysnc></script> <!-- Script below may needs to be executed after the above scripts have loaded async --> <script type="text/javascript"> if(FindApi){var api = new FindApi();api.setApplicationUrl('/');api.setServiceApiBaseUrl('/find_v2/');api.processEventFromCurrentUri();api.bindWindowEvents();api.bindAClickEvent();api.sendBufferedEvents();} </script>
David
Hi,
with my bundled files these are extra files I can spot in my HTML.
Any idea what are these files and how these lines are generating?
Regards
Khurram