<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Configuring number of init.js requests? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1405516#M84224</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/697272"&gt;@JonathanTiu&lt;/a&gt;&amp;nbsp; Yes, we did figure it out. It's related to fine tuning the API and how it uses workers under-the-hood. The size of the workers is just one parameter out of many that affects the initial load performance metrics. Overall, for our baseline testing apps, those metrics improved between 4.27 and 4.29.&lt;BR /&gt;&lt;BR /&gt;With that said, if you have a simple, focused repro app that shows a major performance regression on the initial app load, then please open a Tech Support ticket so they can get this formally documented.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 22:46:23 GMT</pubDate>
    <dc:creator>AndyGup</dc:creator>
    <dc:date>2024-04-03T22:46:23Z</dc:date>
    <item>
      <title>Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346212#M82701</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i read somewhere that the number of init.js requests that ESRi spawns is somehow related to the number of cpu cores you have. is that true? is there a way to configure or control the number of requests that esri makes?&lt;/P&gt;&lt;P&gt;on my laptop, i see 8 requests after the very first init.js request.&lt;/P&gt;&lt;P&gt;for our application we are really sensitive to what we initially download and i'm trying to investigate if there's anything further we can avoid downloading and these 8 requests are quite obvious.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanTiu_0-1699291191258.png" style="width: 887px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85119i20303E2B3BD5DCB7/image-dimensions/887x359?v=v2" width="887" height="359" role="button" title="JonathanTiu_0-1699291191258.png" alt="JonathanTiu_0-1699291191258.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 17:23:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346212#M82701</guid>
      <dc:creator>JonathanTiu</dc:creator>
      <dc:date>2023-11-06T17:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346237#M82702</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/697272"&gt;@JonathanTiu&lt;/a&gt; , yes without getting into all the details, generally speaking the number of worker requests (e.g. init.js) spawned at startup is related to the number of CPUs.&lt;/P&gt;&lt;P&gt;Perhaps more importantly for your situation, we have previously investigated the browser caching of workers, which is related to the init.js requests you are seeing. We discovered that devtools (e.g. Chrome and Firefox) has misreported subsequent worker requests as HTTP 200's. We had to use Charles debugging proxy to verify they were actually being correctly cached as 304s. I don't currently have it installed but I can install/retest on our end. I did just notice that Safari is correctly reporting 304s.&lt;BR /&gt;&lt;BR /&gt;Is this something you can double check on your application?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 18:08:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346237#M82702</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2023-11-06T18:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346244#M82703</link>
      <description>&lt;P&gt;i see so you're saying the first init.js should have been cached as a 304 so it won't ask for those resources again. so i shouldn't be seeing this many init.js requests?&lt;/P&gt;&lt;P&gt;from what i see they're all reported as 200s.&amp;nbsp; so what do i need to do to verify on my side they are actually 304s? install the Charles debugging proxy?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanTiu_0-1699294372723.png" style="width: 784px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85124i5BF495CD4CAC42C2/image-dimensions/784x190?v=v2" width="784" height="190" role="button" title="JonathanTiu_0-1699294372723.png" alt="JonathanTiu_0-1699294372723.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 18:14:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346244#M82703</guid>
      <dc:creator>JonathanTiu</dc:creator>
      <dc:date>2023-11-06T18:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346260#M82704</link>
      <description>&lt;P&gt;Yes, you can use Charles debugging proxy to determine if the requests are being cached for "/esri/core/workers/init.js". Also important, make sure you have unchecked "Disable caching" in the dev tools Network tab.&lt;/P&gt;&lt;P&gt;When the browser is correctly reporting worker caching, you will see at least three HTTP requests to "init.js" in the browser console:&lt;/P&gt;&lt;P&gt;First - &lt;A href="https://js.arcgis.com/4.28/init.js" target="_blank" rel="noopener"&gt;https://js.arcgis.com/4.28/init.js&lt;/A&gt; (HTTP 200)&lt;/P&gt;&lt;P&gt;Second - &lt;A href="https://js.arcgis.com/4.28/esri/core/workers/init.js" target="_blank" rel="noopener"&gt;https://js.arcgis.com/4.28/esri/core/workers/init.js&lt;/A&gt; (HTTP 200)&lt;/P&gt;&lt;P&gt;Third - &lt;A href="https://js.arcgis.com/4.28/esri/core/workers/init.js" target="_blank" rel="noopener"&gt;https://js.arcgis.com/4.28/esri/core/workers/init.js&lt;/A&gt;&amp;nbsp; (HTTP 304)&lt;/P&gt;&lt;P&gt;Here's a screenshot from Safari, as an example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AndyGup_0-1699295950019.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85128i206A3AF7C3325EC3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AndyGup_0-1699295950019.png" alt="AndyGup_0-1699295950019.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 18:46:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346260#M82704</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2023-11-06T18:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346369#M82707</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt;&amp;nbsp; ! Silly question as i've never used Charles proxy before.&lt;/P&gt;&lt;P&gt;i refrehsed my app so it downloaded esri 4.28 again.&lt;/P&gt;&lt;P&gt;i then looked at the charles proxy.&amp;nbsp; where do i look to see if the init.js requests are cached?&amp;nbsp; i see js.arcgis.com so i expanded that node....&lt;/P&gt;&lt;P&gt;i'm trying to find the&amp;nbsp;&lt;A href="https://js.arcgis.com/4.28/esri/core/workers/init.js" target="_blank" rel="noopener"&gt;https://js.arcgis.com/4.28/esri/core/workers/init.js &lt;/A&gt;requests right?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanTiu_0-1699305206984.png" style="width: 641px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85151i1B4B53C0C477435E/image-dimensions/641x302?v=v2" width="641" height="302" role="button" title="JonathanTiu_0-1699305206984.png" alt="JonathanTiu_0-1699305206984.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 01:04:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346369#M82707</guid>
      <dc:creator>JonathanTiu</dc:creator>
      <dc:date>2023-11-07T01:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346521#M82709</link>
      <description>&lt;P&gt;The reason i'm scrutinizing this so closely is because since we moved to 4.28, i've noticed we've gotten slower and i can see these 8 init.js requests get progressively slower. you can see they are stalled for long periods of time - over 100ms.&amp;nbsp; That's huge.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanTiu_0-1699341698157.png" style="width: 921px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85193i8A1A423FCADCDE26/image-dimensions/921x307?v=v2" width="921" height="307" role="button" title="JonathanTiu_0-1699341698157.png" alt="JonathanTiu_0-1699341698157.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whereas in 4.27,&amp;nbsp; we have the same 8 init.js requests but the longest any request has to wait is around 14ms. Absolute huge difference. I also notice the init.jst requests are launched earlier in 4.27. in 4.28 they seem to be launched later which further adds to the delay i'm seeing in our app&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanTiu_1-1699341820128.png" style="width: 865px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85194i8F4B040D4CCB0985/image-dimensions/865x403?v=v2" width="865" height="403" role="button" title="JonathanTiu_1-1699341820128.png" alt="JonathanTiu_1-1699341820128.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 07:24:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346521#M82709</guid>
      <dc:creator>JonathanTiu</dc:creator>
      <dc:date>2023-11-07T07:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346723#M82715</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/697272"&gt;@JonathanTiu&lt;/a&gt;, you should only see the first request to &amp;nbsp;&lt;A href="https://js.arcgis.com/4.28/esri/core/workers/init.js" target="_blank" rel="noopener nofollow noreferrer"&gt;https://js.arcgis.com/4.28/esri/core/workers/init.js&lt;/A&gt;, depending on how you've configured Charles. You shouldn't see any other subsequent requests to the same modules, e.g. init.js. If the browser is caching correctly, there will only be that one request, confirming that browser caching is working correctly. Did that make more sense?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 16:02:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346723#M82715</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2023-11-07T16:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346800#M82716</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/697272"&gt;@JonathanTiu&lt;/a&gt;&amp;nbsp; with regards to the increased init.js request times, thanks for the information. That might be related to a size increase in the worker between 4.27 and 4.28. I can also repro dev tools reporting the init.js requests being stalled when caching is enabled. We need to do some research. I'll open an issue pending some initial investigation. It's not clear what's actually happening versus what might be misreported in dev tools, e.g. 200 vs 304 status response codes.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 17:49:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346800#M82716</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2023-11-07T17:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346822#M82718</link>
      <description>&lt;P&gt;yes it seems the size increase is roughly 40k&amp;nbsp; or so.&amp;nbsp; so in our case with 8 requests, that's an extra 300k plus we're transferring.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i just ran again this morning our app with 4.28.&amp;nbsp; i'm not seeing long stall times but i am seeing long server response times.&amp;nbsp; below is screenshot of the 8th request. each request to &lt;A href="https://js.arcgis.com/4.27/esri/core/workers/init.js," target="_blank"&gt;https://js.arcgis.com/4.27/esri/core/workers/init.js,&lt;/A&gt;&amp;nbsp;the server response wait time gets longer until it reached the peak (of 211ms) in the 8th request.&amp;nbsp; Something bottlenecking?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanTiu_1-1699380513340.png" style="width: 752px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85279iB7255C68471D7B0A/image-dimensions/752x374?v=v2" width="752" height="374" role="button" title="JonathanTiu_1-1699380513340.png" alt="JonathanTiu_1-1699380513340.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 18:10:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1346822#M82718</guid>
      <dc:creator>JonathanTiu</dc:creator>
      <dc:date>2023-11-07T18:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1348935#M82757</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/697272"&gt;@JonathanTiu&lt;/a&gt;I I verified in Charles while using Chrome that the SDK's wasm requests are being correctly cached. Chrome 119 dev tools appear to be incorrectly reporting cached file requests as HTTP 200s. Here's a screenshot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wasm.png" style="width: 650px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85853i704B46998D55D000/image-size/large?v=v2&amp;amp;px=999" role="button" title="wasm.png" alt="wasm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, the wasm scripts are being loaded correctly (synchronously). This is the pattern defined by the WorkerGlobalScope of the browser's Web Workers API,. More information is available on MDN here: &lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts" target="_blank" rel="noopener"&gt;https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts&lt;/A&gt;. As you may know, when stalls are reported in the network tab of the dev console, they can be the result of many different factors. Taking that into account, I didn't see anything unusual after multiple tests.&lt;/P&gt;&lt;P&gt;We will continue to investigate the size of the workers.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 21:24:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1348935#M82757</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2023-11-13T21:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1351792#M82846</link>
      <description>&lt;P&gt;Thanks for checking that&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt;&amp;nbsp; much appreciated!&lt;/P&gt;&lt;P&gt;i did some runs yesterday with esri 3 and did notice stalls as well so not specific to esri 4 - you're right.&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp; Let me know if you come to any conclusion as to why the size of the workers jumped to 163k.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 01:53:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1351792#M82846</guid>
      <dc:creator>JonathanTiu</dc:creator>
      <dc:date>2023-11-21T01:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1404952#M84203</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt;&amp;nbsp; Did you guys manage to figure out why there was an increase in the size of the workers between 4.27 and&amp;nbsp; 4.28?&lt;/P&gt;&lt;P&gt;we've just bumped up to 4.29.&amp;nbsp; i haven't had a chance to see the sizes of the init.js requests in 4.29.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 23:21:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1404952#M84203</guid>
      <dc:creator>JonathanTiu</dc:creator>
      <dc:date>2024-04-02T23:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1405516#M84224</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/697272"&gt;@JonathanTiu&lt;/a&gt;&amp;nbsp; Yes, we did figure it out. It's related to fine tuning the API and how it uses workers under-the-hood. The size of the workers is just one parameter out of many that affects the initial load performance metrics. Overall, for our baseline testing apps, those metrics improved between 4.27 and 4.29.&lt;BR /&gt;&lt;BR /&gt;With that said, if you have a simple, focused repro app that shows a major performance regression on the initial app load, then please open a Tech Support ticket so they can get this formally documented.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 22:46:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1405516#M84224</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2024-04-03T22:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1555133#M86025</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt; and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/697272"&gt;@JonathanTiu&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for raising this interesting topic.&lt;/P&gt;&lt;P&gt;I am facing a similar issue with a custom application built with arcgis-core 4.30 with vitejs. In my case, the issue is that there is not only the `init.js` file that is requested many times but many, many, many, many javascript files !&lt;/P&gt;&lt;P&gt;All files are cached and served from http/2, but even with all these performances considerations, there is still a very noticeable period with no features displayed. At startup, we end up in few seconds in the following situation with the TOC created, basemap loaded:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NicolasGIS_1-1730736593045.png" style="width: 605px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118758iB4717C848F6A5F63/image-dimensions/605x478?v=v2" width="605" height="478" role="button" title="NicolasGIS_1-1730736593045.png" alt="NicolasGIS_1-1730736593045.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but in the backend, it spends its time loading several times (7) a big number of files even from the cache:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NicolasGIS_0-1730736279668.png" style="width: 681px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118755iABD05748560BB688/image-dimensions/681x552?v=v2" width="681" height="552" role="button" title="NicolasGIS_0-1730736279668.png" alt="NicolasGIS_0-1730736279668.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;or another example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NicolasGIS_2-1730737238539.png" style="width: 701px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118760i2F8357414802C6DA/image-dimensions/701x535?v=v2" width="701" height="535" role="button" title="NicolasGIS_2-1730737238539.png" alt="NicolasGIS_2-1730737238539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once it's finally done loading these files, it starts querying the ArcGIS Server to retrieve the data and features start behind displayed.&lt;/P&gt;&lt;P&gt;Even if these files are lightweights, I am under the impression that it has a performance impact.&lt;/P&gt;&lt;P&gt;Here is a small video to illustrate this phenomema:&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6364185645112w960h540r798" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6364185645112" data-account="6161463677001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6161463677001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6364185645112w960h540r798');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.esri.com/t5/video/gallerypage/video-id/6364185645112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;Any idea ? Is it expected behavior ?&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;P&gt;Nicolas&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 08:06:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1555133#M86025</guid>
      <dc:creator>NicolasGIS</dc:creator>
      <dc:date>2024-11-05T08:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1558179#M86065</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/408959"&gt;@NicolasGIS&lt;/a&gt;&amp;nbsp; my recommendation is to open a tech support ticket. That's typically the best route when you have detailed performance concerns.&lt;/P&gt;
&lt;P&gt;Many (most?) of the cache hits that appear to be duplicates are likely related to the APIs web-workers working in parallel. Also, the browser, itself, is making parallel http requests. Oftentimes, what may seem to be sequential activity isn't necessarily so, and you have to look carefully at the network "Timing" section of the Chrome dev tools, or use a more advanced tool like Charles Debugging Proxy. Initial load time is a multi-factorial issue that includes not just the API modules, but also how the app is constructed, the data, the number and types of layers, the type of queries, how the layers are constructed, etc. I hope that helps.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 17:59:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1558179#M86065</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2024-11-13T17:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1563449#M86159</link>
      <description>&lt;P data-unlink="true"&gt;Thanks &lt;SPAN class=""&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt;f&lt;/SPAN&gt;&lt;SPAN class=""&gt;or your reply ! Much appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN class=""&gt;The app architecture and stack is fairly simple: map focused web app built with latest ESRI Maps SDK for javascript (@arcgis/core) and calcite design system. By many aspects it is similar to the new MapViewer. But it does make heavy use of custom workers as described here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/jsapi-resources/tree/main/core-samples/jsapi-custom-workers" target="_blank" rel="noopener"&gt;https://github.com/Esri/jsapi-resources/tree/main/core-samples/jsapi-custom-workers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;All those &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;requests &lt;/SPAN&gt;&lt;/SPAN&gt;delaying the&amp;nbsp;initial load of the map are coming from these custom workers.&lt;/P&gt;&lt;P&gt;The issue does not seem to be data/map related: I can open the very same webmap in the MapViewer and this phenomena does not appear. If I check MapViewer workers requests, they are only 4:&lt;/P&gt;&lt;P&gt;"dojo.js, arcadeUtils.js, FeaturePipelineWorker.js, libtess.js"&lt;/P&gt;&lt;P&gt;MapViewer seems to be built with dojo: could it be possible that many workers scripts are bundled into the "dojo.js" build ? Like forcing it with dojo build profile or something like that ? Should we investigate something equivalent with vite maybe ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 17:38:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1563449#M86159</guid>
      <dc:creator>NicolasGIS</dc:creator>
      <dc:date>2024-11-29T17:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1564005#M86170</link>
      <description>&lt;P&gt;Just referencing another issue that describes pretty much what we are experiencing currently with vite as bundler but in this case it was with arcgis-webpack-plugin and Maps SDK workers:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-webpack-plugin/issues/73" target="_blank"&gt;https://github.com/Esri/arcgis-webpack-plugin/issues/73&lt;/A&gt;&lt;/P&gt;&lt;P&gt;"During runtime, when creating a new feature layer for the first time, there are more than 1500 network requests from web workers (while Chrome limits up to 6 parallel requests) -it which leads to major delay displaying the feature layer."&lt;/P&gt;&lt;P&gt;It is not exactly the same issue as on our side, it is our custom workers instead of the Maps SDK for javascript ones which get requested but the outcome is the same: too many requests from workers leading to delay in displaying the map.&lt;/P&gt;&lt;P&gt;Issue is different but it makes me think that something can be done on the bundler side to prevent this ?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 10:42:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1564005#M86170</guid>
      <dc:creator>NicolasGIS</dc:creator>
      <dc:date>2024-12-03T10:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1564030#M86172</link>
      <description>&lt;P&gt;Did some additional debugging and compare with a simple WebApp using CDN version of the SDK.&lt;/P&gt;&lt;P&gt;I found out that basically our workers are not "bundled" contrary to the CDN version.&lt;/P&gt;&lt;P&gt;As a consequence, initializing the worker "FeaturePipelineWorker", triggers the requests of all the dependencies of this module and there are a lot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NicolasGIS_0-1733230466200.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/120721iDF00921F025E22FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NicolasGIS_0-1733230466200.png" alt="NicolasGIS_0-1733230466200.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;While using in the CDN version, I can see that all these dependencies are bundled in "FeaturePipelineWorker.js". Do you make maybe a separate bundles of all modules of "esri/core/workers/registry" by any chance ?&amp;nbsp; I am still wondering why vite does not do that by default.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 12:58:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1564030#M86172</guid>
      <dc:creator>NicolasGIS</dc:creator>
      <dc:date>2024-12-03T12:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1564307#M86181</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/408959"&gt;@NicolasGIS&lt;/a&gt;&amp;nbsp; please provide a minimal reproducible app so that we can analyze the issue. Here are the guidelines: &lt;A href="https://developers.arcgis.com/javascript/latest/troubleshooting/#minimal-reproducible-application" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/troubleshooting/#minimal-reproducible-application&lt;/A&gt;. &lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 19:55:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1564307#M86181</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2024-12-03T19:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring number of init.js requests?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1564601#M86185</link>
      <description>&lt;P&gt;Thanks for your feedback&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;It is visible on your core samples from "js-api-resources" repository:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/jsapi-resources/tree/main/core-samples/jsapi-custom-workers" target="_blank" rel="noopener"&gt;https://github.com/Esri/jsapi-resources/tree/main/core-samples/jsapi-custom-workers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Run 'npm install', 'npm run build' and serve the build.&lt;/P&gt;&lt;P&gt;You end up with the phenomena described: many requests to individuals workers' dependencies modules.&lt;/P&gt;&lt;P&gt;Don't need to click on "Run spatial Join" to run the custom worker.&lt;/P&gt;&lt;P&gt;Basically, as soon as you make use of custom workers with core, you end up with the phenomena described that is to say loading all the depencies of ESRI Maps SDK workers&amp;nbsp;individually (mainly&amp;nbsp;FeaturePipelineWorker dependencies for simple webmap).&lt;/P&gt;&lt;P&gt;If you compare with a CDN version of the app:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require(["esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "esri/widgets/Legend"], (ArcGISMap, MapView, FeatureLayer, Legend) =&amp;gt;{
    const cityLayer = new FeatureLayer({
        portalItem: {
          id: "e39d04981238498792eb33ea26ba1c09"
        }
      });
     
      const frsLayer = new FeatureLayer({
        portalItem: {
          id: "cdff193a3e3743a5bc770e2743f215b3"
        }
      });
     
      const map = new ArcGISMap({
        basemap: "dark-gray-vector",
        layers: [cityLayer, frsLayer]
      });
     
      const view = new MapView({
        container: "viewDiv",
        map,
        center: [-117.98, 33.96],
        zoom: 12
      });
     
      const legend = new Legend({ view });
      view.ui.add(legend, "top-right");
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;all the worker code is bundled in '&lt;SPAN&gt;&lt;A href="https://js.arcgis.com/4.31/esri/views/2d/layers/features/FeaturePipelineWorker.js" target="_blank" rel="noopener"&gt;https://js.arcgis.com/4.31/esri/views/2d/layers/features/FeaturePipelineWorker.js&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;'&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and there much much less requests:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NicolasGIS_0-1733306093851.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/120863i206F735E09A27C06/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NicolasGIS_0-1733306093851.png" alt="NicolasGIS_0-1733306093851.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 13:14:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/configuring-number-of-init-js-requests/m-p/1564601#M86185</guid>
      <dc:creator>NicolasGIS</dc:creator>
      <dc:date>2024-12-04T13:14:49Z</dc:date>
    </item>
  </channel>
</rss>

