performance test

This commit is contained in:
Constantin Plaiasu 2024-08-26 04:25:22 +03:00
parent 1f2db7b22f
commit 05f842481f
19 changed files with 200 additions and 225 deletions

View file

@ -35,6 +35,7 @@ class Kernel extends HttpKernel
protected $middlewareGroups = [ protected $middlewareGroups = [
'web' => [ 'web' => [
// \App\Http\Middleware\EncryptCookies::class, // \App\Http\Middleware\EncryptCookies::class,
\App\Http\Middleware\AddPreconnectLink::class,
// \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, // \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
// \Illuminate\Session\Middleware\StartSession::class, // \Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\View\Middleware\ShareErrorsFromSession::class, // \Illuminate\View\Middleware\ShareErrorsFromSession::class,
@ -73,4 +74,13 @@ class Kernel extends HttpKernel
// 'prerenderIfCrawler' => \App\Http\Middleware\PrerenderIfCrawler::class, // 'prerenderIfCrawler' => \App\Http\Middleware\PrerenderIfCrawler::class,
// 'blockAdLink' => \App\Http\Middleware\BlockAdLink::class, // 'blockAdLink' => \App\Http\Middleware\BlockAdLink::class,
]; ];
/**
* Responsible for prioritizing the middleware
*
* @var array
*/
protected $middlewarePriority = [
\App\Http\Middleware\AddPreconnectLink::class,
];
} }

View file

@ -1,26 +0,0 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Support\Collection;
class AddLinkHeadersForPreloadedFonts
{
/**
* Handle the incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return \Illuminate\Http\Response
*/
public function handle($request, $next)
{
return tap($next($request), function ($response) {
if (config('fonts') !== []) {
$response->header('Link', Collection::make(config('fonts'))
->map(fn ($url) => "<{$url}>; " . 'rel="preload"; as=font; type="font/woff2"; crossorigin')
->join(', '));
}
});
}
}

View file

@ -0,0 +1,32 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Support\Collection;
class AddPreconnectLink
{
/**
* Handle the incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return \Illuminate\Http\Response
*/
public function handle($request, $next)
{
return tap($next($request), function ($response) {
if (config('preconnect') !== []) {
$response->header('Link', Collection::make(config('preconnect'))
// ->map(fn ($url) => "<{$url}>; " . 'rel="preload"; as=font; type="font/woff2"; crossorigin')
->map(fn ($url) => "<{$url}>; " . 'rel="preconnect"')
->join(', ')
.', <https://code.jquery.com/jquery-3.3.1.min.js>;rel="preload";as="script";crossorigin;nopush'
,
false
);
}
});
}
}
https://code.jquery.com/jquery-3.3.1.min.js

View file

@ -1,6 +0,0 @@
<?php
return [
'https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu4mxK.woff2',
'https://fonts.gstatic.com/s/baijamjuree/v11/LDI1apSCOBt_aeQQ7ftydoa8XsLL.woff2'
];

9
config/preconnect.php Normal file
View file

@ -0,0 +1,9 @@
<?php
return [
'https://i1.wp.com',
'https://code.jquery.com',
'https://fonts.gstatic.com',
'https://cdnjs.cloudflare.com',
'https://qa.softcad.pw',
];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

View file

@ -3,12 +3,8 @@
"file": "assets/lazyload.esm-2_xOKgVb.js", "file": "assets/lazyload.esm-2_xOKgVb.js",
"name": "lazyload.esm" "name": "lazyload.esm"
}, },
"resources/images/home.webp": {
"file": "assets/home-FMopm8hx.webp",
"src": "resources/images/home.webp"
},
"resources/js/app.js": { "resources/js/app.js": {
"file": "assets/app-DMJ9SGkc.js", "file": "assets/app-DKJGArX1.js",
"name": "app", "name": "app",
"src": "resources/js/app.js", "src": "resources/js/app.js",
"isEntry": true "isEntry": true
@ -50,7 +46,7 @@
"isEntry": true "isEntry": true
}, },
"resources/scss/app.scss": { "resources/scss/app.scss": {
"file": "assets/app-BKVzokcy.css", "file": "assets/app-BGWnhPPd.css",
"src": "resources/scss/app.scss", "src": "resources/scss/app.scss",
"isEntry": true "isEntry": true
}, },
@ -60,7 +56,7 @@
"isEntry": true "isEntry": true
}, },
"resources/scss/google-fonts.scss": { "resources/scss/google-fonts.scss": {
"file": "assets/google-fonts-d_fSA0u1.css", "file": "assets/google-fonts-BEIwaWJ4.css",
"src": "resources/scss/google-fonts.scss", "src": "resources/scss/google-fonts.scss",
"isEntry": true "isEntry": true
}, },

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -2,12 +2,26 @@
// Import our custom CSS // Import our custom CSS
// import '../scss/app.scss' // import '../scss/app.scss'
// Import all of Bootstrap's JS // Import all of Bootstrap's JS
// import * as bootstrap from 'bootstrap'
import * as bootstrap from 'bootstrap' import * as bootstrap from 'bootstrap'
import * as Popper from '@popperjs/core' import * as Popper from '@popperjs/core'
// import { Tooltip, Toast, Popover, To } from 'bootstrap'; // import { Tooltip, Toast, Popover, To } from 'bootstrap';
// import 'jquery' // import 'jquery'
// import 'bootstrap'
window.Popper = Popper window.Popper = Popper
import 'bootstrap' // import {Alert} from 'bootstrap'
// import Alert from "./js/dist/alert";
// import Button from "./js/dist/button";
// import Carousel from "./js/dist/carousel";
// import Collapse from "./js/dist/collapse";
// import Dropdown from "./js/dist/dropdown";
// import Modal from "./js/dist/modal";
// import Offcanvas from "./js/dist/offcanvas";
// import Popover from "./js/dist/popover";
// import ScrollSpy from "./js/dist/scrollspy";
// import Tab from "./js/dist/tab";
// import Toast from "./js/dist/toast";
// import Tooltip from "./js/dist/tooltip";
// menu options custom affix // menu options custom affix
var fixed_top = $(".header"); var fixed_top = $(".header");
@ -71,7 +85,7 @@ $(function () {
///lazy loading image script ///lazy loading image script
function lazyLoading(){ /* function lazyLoading(){
let images = document.querySelectorAll('.loading-img'); let images = document.querySelectorAll('.loading-img');
function preloadImage(image) { function preloadImage(image) {
let src = image.getAttribute('data-src'); let src = image.getAttribute('data-src');
@ -98,16 +112,16 @@ function lazyLoading(){
}, imageOptions) }, imageOptions)
} }
lazyLoading(); lazyLoading(); */
(function ($) { // (function ($) {
"user strict"; // "user strict";
// Search options // Search options
$(".search-bar > a").on("click", function () { $(".search-bar > a").on("click", function () {
$(".header-top-search-area").slideToggle(); $(".header-top-search-area").slideToggle();
}); });
})(jQuery); // })($);

View file

@ -4059,71 +4059,7 @@ span.is-active:after {
margin-top: 5px; margin-top: 5px;
} }
/* [ ### countdown block] .draw-countdown {
margin-top: 25px;
} */
.draw-countdown .syotimer__body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
justify-content: center;
}
.draw-countdown .syotimer__body .syotimer-cell {
-webkit-box-flex: 0;
-ms-flex: 0 0 50px;
flex: 0 0 120px;
max-width: 120px;
text-align: center;
position: relative;
background-color: $primary;
border-radius: 5px;
padding: 25px 10px;
margin: 0 10px 25px;
justify-content: center;
}
@media only screen and (max-width: 1479px) {
.draw-countdown .syotimer__body .syotimer-cell {
flex: 0 0 100px;
max-width: 100px;
}
}
@media only screen and (max-width: 1225px) {
.draw-countdown .syotimer__body .syotimer-cell {
margin: 0 5px 10px;
}
}
.draw-countdown .syotimer__body .syotimer-cell .syotimer-cell__value {
font-size: 40px;
font-weight: 600;
margin-bottom: 7px;
line-height: 1em;
color: white;
}
@media only screen and (max-width: 991px) {
.draw-countdown .syotimer__body .syotimer-cell .syotimer-cell__value {
font-size: 28px;
}
}
.draw-countdown .syotimer__body .syotimer-cell .syotimer-cell__unit {
font-size: 16px;
font-weight: 600;
color: white;
}
@media only screen and (max-width: 575px) {
.draw-countdown .syotimer__body .syotimer-cell .syotimer-cell__unit {
font-size: 16px;
}
}
.list-group-item { .list-group-item {
color: #fff; color: #fff;

View file

@ -23,7 +23,7 @@ $secondary:#1B1B3F;
@import "header"; @import "header";
@import "main"; @import "main";
@import "color"; @import "color";
@import "homesearch"; // @import "homesearch";
@import "lazyload"; @import "lazyload";

View file

@ -70,42 +70,42 @@
src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0reHelJo0.woff2) format('woff2'); src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0reHelJo0.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
} }
/* thai */ // /* thai */
@font-face { // @font-face {
font-family: 'Bai Jamjuree'; // font-family: 'Bai Jamjuree';
font-style: normal; // font-style: normal;
font-weight: 600; // font-weight: 600;
font-display: swap; // font-display: swap;
src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0gebegJo0yyg.woff2) format('woff2'); // src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0gebegJo0yyg.woff2) format('woff2');
unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; // unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
} // }
/* vietnamese */ // /* vietnamese */
@font-face { // @font-face {
font-family: 'Bai Jamjuree'; // font-family: 'Bai Jamjuree';
font-style: normal; // font-style: normal;
font-weight: 600; // font-weight: 600;
font-display: swap; // font-display: swap;
src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0gebem5o0yyg.woff2) format('woff2'); // src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0gebem5o0yyg.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; // unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
} // }
/* latin-ext */ // /* latin-ext */
@font-face { // @font-face {
font-family: 'Bai Jamjuree'; // font-family: 'Bai Jamjuree';
font-style: normal; // font-style: normal;
font-weight: 600; // font-weight: 600;
font-display: swap; // font-display: swap;
src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0gebempo0yyg.woff2) format('woff2'); // src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0gebempo0yyg.woff2) format('woff2');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; // unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
} // }
/* latin */ // /* latin */
@font-face { // @font-face {
font-family: 'Bai Jamjuree'; // font-family: 'Bai Jamjuree';
font-style: normal; // font-style: normal;
font-weight: 600; // font-weight: 600;
font-display: swap; // font-display: swap;
src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0gebelJo0.woff2) format('woff2'); // src: url(https://fonts.gstatic.com/s/baijamjuree/v11/LDIqapSCOBt_aeQQ7ftydoa0gebelJo0.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; // unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
} // }
/* cyrillic-ext */ /* cyrillic-ext */
@font-face { @font-face {
font-family: 'Roboto'; font-family: 'Roboto';
@ -169,3 +169,5 @@
src: url(https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2'); src: url(https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
} }
@import 'fa.scss';
@import 'la.scss';

View file

@ -4,6 +4,7 @@
<nav class="navbar navbar-expand-xl align-items-center p-0"> <nav class="navbar navbar-expand-xl align-items-center p-0">
<a class="site-logo site-title" href="{{route('home')}}"> <a class="site-logo site-title" href="{{route('home')}}">
<img src="{{asset('images/logo.svg')}}" width="150" height="37" alt="site-logo"> <img src="{{asset('images/logo.svg')}}" width="150" height="37" alt="site-logo">
<span class="logo-icon"><i class="flaticon-fire"></i></span> <span class="logo-icon"><i class="flaticon-fire"></i></span>
</a> </a>
<button class="navbar-toggler ml-auto" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" type="button" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler ml-auto" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" type="button" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

View file

@ -19,27 +19,30 @@
@if($meta['keywords']) @if($meta['keywords'])
<meta name="keywords" content="{{$meta['keywords']}}"> <meta name="keywords" content="{{$meta['keywords']}}">
@endif @endif
<meta http-equiv="x-dns-prefetch-control" content="on"> {{-- <meta http-equiv="x-dns-prefetch-control" content="on"> --}}
<link rel="dns-prefetch" href="//i1.wp.com"> {{-- <meta http-equiv="x-preconnect-control" content="on"> --}}
<link rel="preconnect" href="https://i1.wp.com" crossorigin> {{-- <link rel="dns-prefetch" href="//i1.wp.com"> --}}
{{-- <link rel="preconnect" href="//i1.wp.com"> --}}
{{-- <link rel="preconnect" href="https://fonts.googleapis.com" crossorigin> --}} {{-- <link rel="preconnect" href="https://fonts.googleapis.com" crossorigin> --}}
<link rel="dns-prefetch" href="//fonts.gstatic.com"> {{-- <link rel="dns-prefetch" href="//fonts.gstatic.com"> --}}
<link rel="dns-prefetch" href="//code.jquery.com"> {{-- <link rel="dns-prefetch" href="//code.jquery.com"> --}}
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com"> {{-- <link rel="dns-prefetch" href="//cdnjs.cloudflare.com"> --}}
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"> {{-- <link rel="preconnect" href="//fonts.gstatic.com">
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin="anonymous"> <link rel="preconnect" href="//cdnjs.cloudflare.com">
<link rel="preconnect" href="https://code.jquery.com" crossorigin="anonymous"> <link rel="preconnect" href="//code.jquery.com"> --}}
{{-- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bai+Jamjuree:wght@400;500;600&display=swap" crossorigin> --}} {{-- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bai+Jamjuree:wght@400;500;600&display=swap" crossorigin> --}}
{{-- @vite(['resources/js/app.js']) --}} {{-- @vite(['resources/js/app.js']) --}}
<style> {{-- <style>
{!! Vite::content('resources/scss/google-fonts.scss') !!} {!! Vite::content('resources/scss/google-fonts.scss') !!}
{!! Vite::content('resources/scss/fa.scss') !!} {!! Vite::content('resources/scss/fa.scss') !!}
{!! Vite::content('resources/scss/la.scss') !!} {!! Vite::content('resources/scss/la.scss') !!}
</style> </style> --}}
{{-- @vite(['resources/js/img.js']) --}} @vite(['resources/js/img.js'])
{{-- <link rel="preload" as="script" href="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"> {{-- <link rel="preload" as="script" href="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> --}} <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> --}}
@vite(['resources/scss/app.scss']) {{-- <style> --}}
<link rel="preload" as="image" type="image/svg" href="{{asset('images/logo.svg')}}" fetchpriority="high"/>
@vite(['resources/scss/app.scss','resources/scss/google-fonts.scss'])
{{-- @vite(['resources/js/jqfix.js']) --}} {{-- @vite(['resources/js/jqfix.js']) --}}
{{-- @vite(['resources/js/app.js']) --}} {{-- @vite(['resources/js/app.js']) --}}
@ -84,8 +87,8 @@
</script> --}} </script> --}}
{{-- <script type='text/javascript' src='https://code.jquery.com/jquery-3.7.1.min.js'></script> --}} {{-- <script type='text/javascript' src='https://code.jquery.com/jquery-3.7.1.min.js'></script> --}}
{{-- <link rel="preload" as="script" href="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"> --}} {{-- <link rel="preload" as="script" href="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"> --}}
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> <script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin></script>
@vite(['resources/js/img.js']) {{-- @vite(['resources/js/img.js']) --}}
{{-- @vite(['resources/js/jqfix.js']) --}} {{-- @vite(['resources/js/jqfix.js']) --}}
@vite(['resources/js/app.js']) @vite(['resources/js/app.js'])
@yield('footer') @yield('footer')