Answers.Body: <p>Screenshot looks like FE, not BE.</p>
  <p>This happens when you use <code>{% js on load %}</code> or <code>{% js on ready %}</code></p>
  <p>For now I switched to <code>{% js %}</code> and wrapped my script with <code>jQuery(function ($) { ... })</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-14T13:35:32.197Z
Answers.LastActivityDate: 2021-08-17T20:52:08.177Z
Answers.LastEditDate: 2021-08-17T20:52:08.177Z
Answers.UserDisplayName: Leo Leoncio
Answers.Body: <p>If any of your image transforms have not previously been processed they will make a call to <code>/cpresources/...</code> To prevent this, generate all your transforms before page load with the <a href="https://craftcms.com/docs/3.x/config/config-settings.html#generatetransformsbeforepageload" rel="nofollow noreferrer">generateTransformsBeforePageLoad</a> config setting:</p>
  <pre><code>'generateTransformsBeforePageLoad' =&gt; true
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-20T03:14:05.017Z
Answers.Text: What do image transforms have to do with jquery?
Answers.UserDisplayName: Bryce
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-18T09:04:57.653Z
Answers.LastActivityDate: 2020-12-18T09:04:57.653Z
Answers.UserDisplayName: James Smith
Body: <p>I've been doing some performance checks on a website I'm building, and noticed that jQuery 3.5.1 is being loaded via cpresources:</p>
  <p><a href="https://i.sstatic.net/tyIrj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tyIrj.png" alt="Sources pabel" /></a></p>
  <p>Why is it doing this? And can I stop it? I'm already loading jQuery 3.5.1 in my <code>scripts.js</code> file (combined with some other stuff and minified using gulp &amp; webpack).</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-17T22:09:23.057Z
Comments.Text: Do you have any plugins installed?
Comments.UserDisplayName: dmatthams
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-20T03:13:40.137Z
Comments.Text: I do ya... come to think of it, I bet Wheel Form is the culprit
Comments.UserDisplayName: Bryce
Tags: <cache><optimization>
Title: Why is Craft loading jQuery via cpresources? And can I stop it?
ThreadText: # Why is Craft loading jQuery via cpresources? And can I stop it?
  
  (Asked by: username_0 on 2020-12-17)
  
  I've been doing some performance checks on a website I'm building, and noticed that jQuery 3.5.1 is being loaded via cpresources:
  
  [![Sources pabel](https://i.sstatic.net/tyIrj.png)](https://i.sstatic.net/tyIrj.png)
  
  Why is it doing this? And can I stop it? I'm already loading jQuery 3.5.1 in my `scripts.js` file (combined with some other stuff and minified using gulp & webpack).
  
  **Tags:** cache, optimization
  
  > **Comments:**
  > **username_1**: Do you have any plugins installed?  
  > **username_0**: I do ya... come to think of it, I bet Wheel Form is the culprit  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-08-14. Score: 1
  
  Screenshot looks like FE, not BE.
  
  This happens when you use `{% js on load %}` or `{% js on ready %}`
  
  For now I switched to `{% js %}` and wrapped my script with `jQuery(function ($) { ... })`
  
  
  ---
  
  ### Answer by username_3 on 2020-12-18. Score: 1
  
  If any of your image transforms have not previously been processed they will make a call to `/cpresources/...` To prevent this, generate all your transforms before page load with the [generateTransformsBeforePageLoad](https://craftcms.com/docs/3.x/config/config-settings.html#generatetransformsbeforepageload) config setting:
  
  ```
  'generateTransformsBeforePageLoad' => true
  
  ```
  
  > **Comments:**
  > **username_0**: What do image transforms have to do with jquery?  
  
  ---
  
  