Qtip2 loads a "jquery.qtip.min.map" from internet and slows down site
Asked Answered
F

3

7

I included Qtip2 on my site and used the following snippets while the files are hosted on my own server as mentioned here:

<!-- jQuery FIRST i.e. before qTip (and all other scripts too usually) -->
<script type="text/javascript" src="/scripts/jquery.min.js"></script>

<!-- Include either the minifed or production version, NOT both!! -->
<script type="text/javascript" src="/scripts/jquery.qtip.js"></script>

Though hosted on the same server as the website the script loads the following additional file from the CDN of Qtip2:

https://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.min.map

This slows down my side extremely: enter image description here

I could not find any information about this. Any idea how to avoid (if not necessary) or replace and host on my own server?

Formidable answered 9/5, 2014 at 17:38 Comment(4)
Open up the jquery.qtip.js file in a text editor and see if there's a source map URL comment at the end of the file.Coverup
Thanks for the hint looking into the JS file. There wasn't any info. Though I don't want to rely on the hope that removing doesn't produce any errors. I first have to know if the file is necessary. Any idea why I got -1 for this question?Formidable
This still hasn't been fixed. I want to serve the JS files from the CDN and not locally, so commenting out the .min.map isn't an option for me. Is there no solution at the moment?Oversew
Why bother at all? It's not a problem the user sees. You may report this as bug: github.com/qTip2/qTip2/issuesFormidable
F
10

The *.map file is a source map. It contains informations like function positions of the non-minified source code of Qtip2. Notice that I used the minified version of it on my webpage.

Source maps help to develop with a postprocessed (e.g. minified) source code without losing the ability to look into the code, for example when errors occur.

The chrome debugger as you can see on the image in my question above downloads it by default. After disabling that function in the debugger settings the file won't be downloaded any longer.

Take a look at this video for a short information or this documentation from Google.

Firefox offers the same feature as you can see here.

Formidable answered 9/5, 2014 at 22:11 Comment(0)
P
11

The final line of the Qtip2 script is a line lke this:

//# sourceMappingURL=http://cdnjs.cloudflare.com/.../jquery.qtip.min.map

Unfortunately the URL currently returns a 404. If you're hosting Qtip2 yourself, you should be able to find and remove that line at the end of the script. Otherwise, don't worry too much because the .map file is only requested when Developer Tools is open. Normal visitors won't download it.

Here's more info on .map files: jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found)

Pastis answered 31/7, 2014 at 21:9 Comment(0)
F
10

The *.map file is a source map. It contains informations like function positions of the non-minified source code of Qtip2. Notice that I used the minified version of it on my webpage.

Source maps help to develop with a postprocessed (e.g. minified) source code without losing the ability to look into the code, for example when errors occur.

The chrome debugger as you can see on the image in my question above downloads it by default. After disabling that function in the debugger settings the file won't be downloaded any longer.

Take a look at this video for a short information or this documentation from Google.

Firefox offers the same feature as you can see here.

Formidable answered 9/5, 2014 at 22:11 Comment(0)
N
1

I have downloaded this plugin from here and the problem is solved!

http://qtip2.com/v/2.2.1/

Noted answered 13/3, 2015 at 18:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.