The application works with SSL without loading all scripts / CSS on the first visit

I hope this is not difficult. I have a web application that does not load all javascript / css / images on the first visit . The second visit is wonderful.

After approximately 2 minutes of inactivity, the problem will recur.

These problems just started with after which the client requested SSL for the application.

Ajax requests stop working after 2 minutes of activity, despite the successful page loading of all javascript elements.

The application timeout is 30 minutes - as I said, everything was fine before using SSL.

All javascript and CSS files use absolute URLs like https: // blablabla

It seems that there is no template why some files arent uploaded. Firebug Net output displays status for failed items as Canceled . For example, site.css and nav.css are in the same folder, are declared to each other in the header, but one loads and the other does not. Both will load after the page is refreshed (if about two minutes have not passed).

An Ajax request also appears as aborted after two minutes. However, if I make the request again, the Ajax request will succeed . Almost as if the first request woke up something.

None of these issues occur in Chrome

Any ideas? :)

FYI is an .Net 4 C # MVC application running under IIS7, but I'm not sure if it matters, since it works in Chrome. Everything worked fine before using SSL.

+4
source share
1 answer

Removed SSL throughout the board and protected action methods using [RequireHttps]. Then we changed the scripts and CSS in the main files to point to the absolute URLs of the URL. Then Javascript worked with the ajax fix.

If anyone knows why CSS / Javascript has broken SSL, it would be cool. I guess this is possibly a workload? Since it worked a second time, I assume half of the CSS and scripts were cached, which reduces the load on SSL?

Anyway, work now!

0
source

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


All Articles