Answer the question
In order to leave comments, you need to log in
How to save main.js, main.css in browser's localstorage?
There is a modem, nevo has a web interface .. you need to make the pages load faster, since the bandwidth to WEBUI is about 2 Mbps.
There is a page with href="../css/main.css" how to save main.css to localstorage
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link type="text/css" rel="stylesheet" href="../css/main.css" />
<script type="text/javascript" src="../lib/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../lib/log4javascript_lite.js"></script>
<script type="text/javascript" src="../lib/jquery.qtip.js"></script>
<script type="text/javascript" src="../lib/jquery.corner.js"></script>
<script type="text/javascript" src="../js/changelang.js"></script>
<script type="text/javascript" src="../js/ping.js"></script>
<script type="text/javascript" src="../js/main.js"></script>
<script type="text/javascript" src="../js/redirect.js"></script>
<script type="text/javascript" src="../js/validation.js"></script>
<script type="text/javascript" src="../js/home.js"></script>
<title></title>
</head>
Answer the question
In order to leave comments, you need to log in
Если нету стилей в localStorage
скачать (jQuery.ajax или fetch) и записать в localStorage
Если/когда стили уже есть
создать элемент <style>, поместить туда стили из localStorage, добавить в <head>
If you want to increase the loading speed, then main.css in the local store will not give you a big increase, unless of course it weighs 10mb, which is unlikely. there will also be problems with updating this very store - the user may have problems with styles if you update something.
Compress all js files into one, you can even compress and place the code directly in the 'head' header, you can do the same with css. This way you will reduce the number of requests to the server.
<head>
<style>
Ваш css
</style>
<script>
Ваш js
</script>
</head>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question