Dmitriy
Dmitriy

Reputation: 207

bootstrap stylesheet are loaded twice

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
</head>
<body>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
</body>
</html>

In chrome network I can see what bootstrap.min.css was loaded twice. Can anybody explain me why? v.57 on win 8.1 chrome network

Upvotes: 7

Views: 2077

Answers (2)

Kenneth M. Kolano
Kenneth M. Kolano

Reputation: 321

I'm not clear this is related to integrity tags. With or without them I see multiple loads of bootstrap.min.css in Firefox's Web Dev Network pane.

This seems to be due to the Bootstrap JS including a separate call to it. Though for performance reasons it's for the best to persist the direct load of the CSS.

Upvotes: 0

zenofewords
zenofewords

Reputation: 452

Found some info about the issue here.

The integrity attribute for link elements has not yet been implemented and there’s an open spec issue about it. This means the presence of any integrity metadata will currently discard preloaded resources. In the wild, it can also result in duplicate requests where you have to make a trade-off between security and performance.

Upvotes: 8

Related Questions