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