Nginx image, css, js cache, and nginxcssjs Cache

Source: Internet
Author: User

Nginx image, css, js cache, and nginxcssjs Cache

At the beginning, we set up the nginx environment to achieve load balancing and distributed clusters. Now we can use the nginx cache mechanism to optimize the speed. The following describes the cache of nginx images, css, and js.

# Set the image cache time location ~ . *. (Gif | jpg | jpeg | png | bmp | swf) $ {expires 8d;} # Set the JS and CSS cache time location ~ . *. (Js | css )? $ {Expires 2 h ;}
You can see that by setting the expiration time, you can reduce the access burden on the background.




Images in css are not cached, and images in js are not cached, right ??

The cache is done by the browser. What do you mean by the question?

How can we solve the impact of css js and images on website loading speed?

(1) Before you specify the image size to load the image, your browser starts rendering the page. The image size helps it surround irreplaceable elements. If no size is specified, your browser will return back once the image is downloaded. To do this, I suggest using the height and width label specifications in the

Related Article

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.