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 wordpress deletes css and js request parameters and why

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains "wordpress how to delete css and js request parameters and why to delete", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "wordpress how to delete css and js request parameters and why to delete" bar!

First, find the function.php under our topic, and then add the following code to the php file:

Function remove_script_css_query_params ($src) {if (strstr ($src, "trustauth.cn")) {$parts = explode ('?', $src); return $parts [0];} else {return $src;}} add_filter ('script_loader_src',' remove_script_css_query_params', 10,1); add_filter ('style_loader_src',' remove_script_css_query_params', 10,1)

It should be noted that the red domain name trustauth.cn only removes the css and js requests under the domain name, so replace it with your domain name, and it will be a perfect way to pave the way for static resource cdn acceleration. Never replace it with something else, such as the useso.com of 360, or you won't be able to load it into the external resource of fonts. So if you think your wordpress is relatively fast, then there is not much need to do this operation. Anyway, the editor joined in. The speed is about twice as fast.

Thank you for your reading, the above is "wordpress how to delete css and js request parameters and why to delete" the content, after the study of this article, I believe you on wordpress how to delete css and js request parameters and why to delete this problem has a deeper understanding, the specific use of the need for practice to verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Internet Technology

Wechat

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

12
Report