国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home php教程 PHP開發(fā) Using the apache module under Windows to merge multiple js and css to improve web page loading speed

Using the apache module under Windows to merge multiple js and css to improve web page loading speed

Jan 04, 2017 am 10:39 AM

Today’s websites are becoming more and more expressive, and more and more js and css are loaded on the page. When there are too many js and css on the website page, the browser will open the page very slowly, which significantly reduces the user experience. Using mod_concatx, multiple files can be merged into one http response message, which can effectively improve the loading speed of js/css.

The sample effect is as follows:

Using the apache module under Windows to merge multiple js and css to improve web page loading speed

The mod_concatx module is modified based on mod_concat, thanks for their work.

The original mod_concat module has great reference value, but it has little actual use.

This module has the following three problems:

1. Data will be re-sent to the client every time, and the browser cache is not properly used.
2. There are security vulnerabilities that cause the server to The program is downloaded, such as "/??jquery.js,common.php"
3. When merging each file, there is no gap in between, causing the content to stick together, which may cause errors

Instructions for use:

<link href="/style/??css1.css,css2.css,css3.css" type="text/css" rel="stylesheet"/>
<script src="/js/??js1.js,js2.js,js3.js,js4.js" type="text/javascript"></script>

Module configuration:

Open the apache configuration file httpd.conf

LoadModule concatx_module modules/mod_concatx.dll

Advanced configuration: (The following is the default configuration, you can not configure it)

<IfModule concatx_module>
ConcatxDisable Off
ConcatxCheckModified On
ConcatxSeparator On
ConcatxMaxSize 1024
ConcatxMaxCount 10
ConcatxFileType js,css
</IfModule>

Details Description:

ConcatxDisable On/Off
//是否使用mod_concatx模塊
ConcatxCheckModified On/Off
//檢查文件是否改動,建議On
ConcatxSeparator On/Off
//合并文件時是否加換行分隔,建議On
ConcatxMaxSize 數(shù)字
//合并文件總大小限制最大值,建議不要太大
ConcatxMaxCount 數(shù)字
//合并文件總個數(shù)限制最大值,建議不要太大
ConcatxFileType js,css
//合并文件類型限制,如不限制填","

Final words:
It is recommended to compile this module yourself, safe and secure

Later improvement direction:
todo: Consider adding js, css compression
todo: Consider Support files parsed by zend
bug: There is a default page loading exception in the directory (consider upper-level hook processing)


More uses the apache module under Windows to merge multiple js , css improves web page loading speed related articles, please pay attention to PHP Chinese website!


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)