In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Configure Nginx web page caching time
When Nginx returns the web page data to the client, the caching time can be set to facilitate the direct return of requests for the same content in the future, avoiding repeated requests and speeding up the access speed. Generally, it is set for static web pages, but not for dynamic web pages. You can use fiddler in the Windows client to view the page cache time.
Setting method
You can modify the configuration file to add expired parameters for specific content in the http section, or the server section, or the location section
1. Copy the picture to the site directory [root@localhost nginx-1.12.2] # cd / mnt/tools/ [root@localhost tools] # lsawstats-7.6.tar.gz fiddler.exe jdk-8u191-windows-x64.zip LNMP zhuang.mp4cronolog-1.6.2-14.el7.x86_64.rpm forbid.png john-1.8.0.tar.gz Picture.jpgextundelete-0.2.4.tar.bz2 intellijideau2018.rar LAMP-C7 yuan.mp4 [root@localhost tools] # cp picture.jpg / usr/local/nginx/html/ copy the image [root@localhost tools] # cd / usr/local/nginx/html/ [root@localhost html] # ls50x.html index.html picture.jpg [root@localhost html] # 2. Add a reference image [root@localhost html] # vim index.htmlWelcome to nginx to the home file!
/ / add [root@localhost html] # systemctl stop firewalld.service / / disable the firewall [root@localhost html] # setenforce 0 / / disable the enhanced security feature [root@localhost html] # 3. Use the win10 virtual machine to access the nginx service and grab the package (caching is not enabled)
4. Add the cache module [root@localhost html] # vim / usr/local/nginx/conf/nginx.conf location ~\. (gif | jepg | jpg | ico | bmp | png) ${/ / add cache root html; / / site expires 1d; / / cache for one day} [root@localhost html] # service nginx restart / / restart the service [root@localhost html] # 5. Use the win10 virtual machine to access the nginx service again, grab the package (enable caching)
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.