locked
How To Clean Nginx Cache? [SOLVED] RRS feed

  • Question

  • User856008996 posted

    Hello there,

    I uploaded the new version of my ASP.NET Core website that I published with Nginx via FTP. But still the old version appears on the air. I updated the files, but the files were not updated on the Nginx side.

    How do you know that you can say that it is not updated. I published my site with incorrect database information in appsettings.json file. I entered the correct information and reloaded the appsettings.json file, but no change was made. I misspelled some javascript files I called, I changed them, but they were not updated again.

    You can say delete browser history. I deleted it, but the problem persists. I want the features like Cache and gzip to remain active in terms of site speed. But after publishing an update, I want to delete cache and continue with the new version. I would be glad if you could help.

    Nginx/sites-available/default 

    server {
    	listen 80 default_server;
    	listen [::]:80 default_server ipv6only=on;
    
    	server_name sansurlu.com www.sansurlu.com;
    
    	root /var/www/sansurlu;
    	index index.html;
    
    
     gzip  on;
        gzip_http_version 1.1;
        gzip_vary on;
        gzip_comp_level 6;
        gzip_proxied any;
        #gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;
        gzip_buffers 16 8k;
        gzip_disable “MSIE [1-6].(?!.*SV1)”;
    
    
    
    	location ~* /(css|js) {
    		root /var/www/sansurlu/wwwroot;		
    	}
    
    	location ~/assets/images {
    		root /var/www/sansurlu/wwwroot;
    	}
    
    	location ~/assets/font-awesome{
    		root /var/www/sansurlu/wwwroot;
    	}
    
     location / {
     proxy_pass http://localhost:5000;
     proxy_http_version 1.1;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection keep-alive;
     proxy_set_header Host $host;
     proxy_cache_bypass $http_upgrade;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Proto $scheme;
     }
    
    }

    Solution

    I forgot that the Kestrel server and Nginx server are working together. Since the old application is still running on the Kestrel side, the old version seems to be. There is no application or Nginx-sided cache problem. The new version was released without any problem when I re-launched the ASP.NET Core web application with the command "dotnet /path/...dll"

    Sunday, May 31, 2020 1:43 PM

Answers

  • User856008996 posted

    I forgot that the Kestrel server and Nginx server are working together. Since the old application is still running on the Kestrel side, the old version seems to be. There is no application or Nginx-sided cache problem. The new version was released without any problem when I re-launched the ASP.NET Core web application with the command "dotnet /path/...dll"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 31, 2020 9:06 PM

All replies

  • User-474980206 posted

    You should configure the ngnix purge command

       https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/

    Sunday, May 31, 2020 3:49 PM
  • User856008996 posted

    When I apply the changes in nginx.conf and default files and update them with the reload command, what causes the error?

    Sunday, May 31, 2020 4:56 PM
  • User856008996 posted

    I changed the javascript file from quote to quote, but it still looks like contact.js

    Sunday, May 31, 2020 8:19 PM
  • User856008996 posted

    I forgot that the Kestrel server and Nginx server are working together. Since the old application is still running on the Kestrel side, the old version seems to be. There is no application or Nginx-sided cache problem. The new version was released without any problem when I re-launched the ASP.NET Core web application with the command "dotnet /path/...dll"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 31, 2020 9:06 PM