How to use a php script to add version _ PHP to the js and css paths referenced in html

Source: Internet
Author: User
This article mainly introduces how to use php scripts to add version numbers to the js and css paths referenced in html. the advantage of using the version number is that it can solve the problem of real-time update of external application files, let's take a look at the full text and search for keywords in the search engine. htaccess cache, you can find a lot of tutorials on setting website file cache. through setting, you can cache infrequently updated files such as css and js on the browser side, in this way, every time a visitor accesses your website, the browser can obtain css and js from the browser's cache without reading from your server, in this way, the website opening speed is accelerated to a certain extent, and the traffic on your servers can be saved.

I will not talk about the specific text description. I will explain it to you through code examples below.

For example

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.