Title: Loading JS when not needed
Last modified: August 22, 2016

---

# Loading JS when not needed

 *  Resolved [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/loading-js-when-not-needed-1/)
 * I have just run a couple of speed tests om my site, and it seems that some JS
   files for NextGen Gallery are fetched even when they aren’t needed.
 * We are talking about 5 requests with a combined weight at about 12.8Kb:
    photocrati_nextgen/
   modules/ajax/static/ajax.js photocrati_nextgen/modules/ajax/static/persist.js
   photocrati_nextgen/modules/ajax/static/store.js photocrati_nextgen/modules/ajax/
   static/ngg_store.js photocrati_nextgen/modules/lightbox/static/lightbox_context.
   js
 * Example page with the problem: [https://www.musalaha.org/about-us/who-we-are/](https://www.musalaha.org/about-us/who-we-are/)
 * Sidenote: Can it be true that some of JS is not minimized?
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/loading-js-when-not-needed-1/#post-5567503)
 * [@squazz](https://wordpress.org/support/users/squazz/) – We are addressing script
   loading in our next (major) release … these results will not likely be relevant
   after that update.
 * Thanks!
 * – Cais.
 *  Thread Starter [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/loading-js-when-not-needed-1/#post-5567583)
 * Thanks! 😀 I will be looking forward to that 🙂
 * Even though it’s not a lot of data, it’s still 5 HTTP requests 😛
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/loading-js-when-not-needed-1/#post-5567643)
 * [@squazz](https://wordpress.org/support/users/squazz/) – Watch for a beta announcement
   in the next week or two … we’d like to get some more eyes on it if you are interested.
 * Thanks!
 * – Cais.
 *  Thread Starter [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/loading-js-when-not-needed-1/#post-5567693)
 * Will do 🙂
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/loading-js-when-not-needed-1/#post-5567726)
 * [@squazz](https://wordpress.org/support/users/squazz/) – Another option to consider
   is the NextGEN Gallery Optimizer plugin by Mark Jeldi … one of its main features
   is based on this premise as well.
 * – Cais.
 *  Thread Starter [Squazz](https://wordpress.org/support/users/squazz/)
 * (@squazz)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/loading-js-when-not-needed-1/#post-5567727)
 * that would solve my problem, but for you as a developer it has to be a letdown
   that it is needed for other developers to develop plugins that fixes your sloppyness
   😉
 * I will be loooking forward to the point where your plugin is optmized with out
   3. party plugins.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/loading-js-when-not-needed-1/#post-5567730)
 * [@squazz](https://wordpress.org/support/users/squazz/) – You are more than welcome
   to wait for our implementation … I just suggested this other quality plugin if
   you are too impatient to do so.
 * – Cais.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Loading JS when not needed’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [js](https://wordpress.org/support/topic-tag/js/)
 * [nextgen](https://wordpress.org/support/topic-tag/nextgen/)

 * 7 replies
 * 2 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/loading-js-when-not-needed-1/#post-5567730)
 * Status: resolved