Delete Cache Nginx (Not a virtual box)

July 25, 2015 16.4k views
LEMP Nginx PHP

Hey folks. I'm running a Laravel Site (Ubuntu) on Nginx (Not a virtual box). When I make changes to a css file, or any file for that matter i'm unable to see the changes right away. I've tried changing sendfile from on to off as noted in this link:

http://stackoverflow.com/questions/6236078/how-to-clear-the-cache-of-nginx

And I couldn't find a Nginx cache file to delete the cache. Many sites recommend going to the "path/to/cache" folder but I can't find it:

https://www.nginx.com/blog/nginx-caching-guide/

Anyway I don't believe I set up any kind of proxy caching or anything. Any ideas where I can find my cache so I can delete it folks? For that matter am I looking to do the correct thing here? Thanks for you answer in advance.

3 Answers

Nginx doesn't do any caching by default. If you haven't set any caching up in nginx, what makes you think it's caching anything? And what issue are you trying to solve here that needs this cache cleared?

Good point. Yes I haven't set up any caching. The problem i'm trying to solve is when I make changes to a css file, or any file for that matter i'm unable to see the changes right away.

Someone gave me a good answer to my question (because i'm using laravel) on stackoverflow. I'll share the answer for someone looking but it still didn't solve my problem:

First, css is something that the client caches, not the server. You should clear your browser's cache to see your css changes. Furthermore, browser caching is a common problem in css and javascript development. Luckily, you can take advantage of elixir, which ships with laravel 5.1, to prevent browsers caching your assets.

Visit the docs for more info on laravel elixir.

http://laravel.com/docs/5.1/elixir#versioning-and-cache-busting

Second, laravel gives us a convenient command to clear your server's cache:

php artisan cache:clear

Have another answer? Share your knowledge.