2 group:group1 path:M00/00/00/wKgMLFpLO-GAR41SAAd8hCbLY3Y765.jpg

I can access the picture correctly

However, I deleted the image

When I revisit the image, I can still access it successfully.

The problem I encountered was that I had cleared the browser cache before accessing it. The browser cache problem was resolved, and NOW I continue troubleshooting the problem.

###What did you do today

Then I think it’s the Nginx cache

  • Enter/fastdfs/cache/nginx/proxy_cache/directory, we can see the cache file.

  • To open the file with Notepad, we can see proxy_cache_key

  • So why is proxy_cache_key formed this way? We can open nginx.conf under Tracker1 (192.168.12.11).

  • We set proxy_cache_key to combine the URI parameter into the web cache key, and Nginx stores the cache contents in the secondary cache directory based on the hash of the key value. That is above/fastdfs/cache/nginx/proxy_cache/d / 90

proxy_cache_key is_args$args;

  • How to clear the nginx cache, we can look at the configuration in nginx.conf.

  • This means that we can purge the cache by calling /purge/proxy_cache_key.

Location ~/purge(/.*) {allow 127.0.0.1; Allow 192.168.12.0/24; deny all; proxy_cache_purge http-cacheThe $1$is_args$args;
                error_page 405 =200 /purgeThe $1;
        }
Copy the code
  • Then we visit http://192.168.12.111/fastdfs/purge/group1/M00/00/00/wKgMLFpLO-GAR41SAAd8hCbLY3Y765.jpg, according to clear the cache of our success!

  • Alacrity, we continue to visit before pictures urlhttp: / / 192.168.12.111 fastdfs/group1 / M00/00/00 / wKgMLFpLO – GAR41SAAd8hCbLY3Y765. JPG, found at this time has not been to visit!


###Summary

According to the requirements of the project, 8 units are not needed for the time being. The solution I currently use is virtual machine + Keepalived + Nginx, or LVS + Keepalived + Nginx. So I attached the optimized topology.