Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use apache module to merge multiple js/css under Windows

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article "Windows how to use apache module to achieve the merger of multiple js/css" article knowledge point most people do not understand, so Xiaobian to you summarized the following content, detailed content, clear steps, has a certain reference value, I hope you can read this article to gain, let's take a look at this article "Windows how to use apache module to achieve the merger of multiple js/css" article bar.

Now the website performance is more and more rich, page loading js and css nature is also more and more. When there are too many js and css on a website page, the browser will open the page slowly, significantly reducing the user experience. Using mod_concatx, you can combine multiple files in one http response message, which can effectively improve the loading speed of js/css.

Example effects are as follows:

mod_concatx module is modified from mod_concat, thanks to their work.

The original mod_concat module has great reference value, but it has little practical effect.

There are three problems with this module:

1. Each time, data will be sent to the client again, and the browser cache is not used reasonably.

2. There are security vulnerabilities that cause server-side programs to be downloaded, such as "/?? jquery.js,common.php"

3. There is no gap in the middle when merging each file, resulting in content sticking together, which may cause errors.

So I wrote mod_concatx module based on mod_concat, which solved some of the problems mentioned earlier.

Download address: (with source code, dll, updated apache 2.2/2.4 64-bit version)

Google hosting address:

How to use:

The copy code is as follows:

Module configuration:

Open the apache configuration file httpd.conf

The copy code is as follows:

loadmodule concatx_module modules/mod_concatx.dll

Advanced configuration: (The following is the default configuration, can not be configured)

The copy code is as follows:

concatxdisable off

concatxcheckmodified on

concatxseparator on

concatxmaxsize 1024

concatxmaxcount 10

concatxfiletype js,css

Details:

The copy code is as follows:

concatxdisable on/off

//whether to use mod_concatx module

concatxcheckmodified on/off

//check whether the file has changed, suggest on

concatxseparator on/off

//Whether to add newline separation when merging files, it is recommended on

concatxmaxsize number

//Maximum combined file size limit, not too large recommended

concatxmaxcount number

//Maximum number of merged files. It is recommended not to be too large

concatxfiletype js,css

//Merge file type restrictions, if no restrictions fill in ","

The above is about "how to use apache module to merge multiple js/css under Windows" The content of this article, I believe everyone has a certain understanding, I hope the content shared by Xiaobian is helpful to everyone, if you want to know more related knowledge content, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report