Laravel css和JS资源每页加载两次?

时间:2017-03-10 19:47:42

标签: javascript laravel laravel-5.4

我遇到了一个奇怪的问题,每页加载多个css / js资源加载两次。缓存已清除。不知道发生了什么事?发生在我的开发环境和现场环境中。

当您查看页面的来源显然它们只是在他们一次 - 但是网络选项卡显示它们反复加载并且app.js文件是怪物它显然导致延迟问题。

enter image description here

其他人遇到此问题或知道可能导致此问题的原因是什么?

头部:

<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
<!-- Google Font -->
<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300' rel='stylesheet' type='text/css'>
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Title</title>

<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Custom styles for this template -->
<link href="{{ asset('css/sticky-footer-navbar.css') }}" rel="stylesheet">
<link href="{{ asset('css/custom.css') }}" rel="stylesheet">
<link href="{{ asset('css/jPushMenu.css') }}" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- Scripts -->
<script>
    window.Laravel = {!! json_encode([
        'csrfToken' => csrf_token(),
    ]) !!};
</script>

FooterJS:

 <!-- Scripts -->
<script src="{{ asset('js/app.js') }}"></script>
</body>
</html>

干杯

CITTI

0 个答案:

没有答案