Read the script tag source from cache in Firefox.

I am adding some error messages to my application. I want to be able to report a method name from a class, even if the function can be anonymous.

So far, my solution has included reading the source of the script tag, loading it with XmlHttpRequest. My problem is that Firefox will not load from the cache and is always called to the server (chrome uses the cache, and I have not started it in IE yet). Since my project has thousands of lines of code, a second server request takes undesirable time.

Does anyone know how to make Firefox check cache? If this is not the case, is there a way to read the script source directly from the script tag? Is there any other way to get a source that I haven't thought about?

+3
source share
2 answers

Have you considered a bug in Firefox? Use bugzilla.mozilla.org . (If he asks you where you want to write the error, use Product: "Core", Component: "Networking: Cache".)

Safety rules vary for <script>vs. XHR ... but that really doesn’t mean that Firefox skips the cache.

+1
source

This site can help: http://blog.httpwatch.com/2009/08/07/ajax-caching-two-important-facts/ http://www.httpwatch.com/demos/ajax_caching/

HTTP, PHP script, script apporarite.

jQuery.ajax({type: "script", cache: true})? . http://api.jquery.com/jQuery.ajax/

0

Source: https://habr.com/ru/post/1780799/


All Articles