0

Many times i see "Error 304" in django, but when i google about it i go through many answers which mean that- "This does not really indicate an error, but rather indicates that the resource for the requested URL has not changed since last accessed or cached."

Error-[20/Aug/2015 17:56:19] "GET /static/dashgumfree/Theme/assets/font-awesome/css/font-awesome.css HTTP/1.1" 304

What i noticed is that mostly this happens in case of css and js files, I just want to know why i am getting the 304 warning if i have saved the requested file. Also tell me how to get rid of that problem and what is root cause of that error in django.

Rahul Rathi
  • 249
  • 1
  • 3
  • 6
  • 3
    You've already got your answer so the real question is why you won't accept it and insist on calling it an "error". The [304 status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection) means **Resource Not Modified** and indicates to the browser that it doesn't need to request the content again, and can instead use its cached version. This is in no sense an error, and stopping it from happening would be detrimental to the performance of your site. – Two-Bit Alchemist Aug 20 '15 at 18:25

1 Answers1

4

304 Not Modified It is not actually an error. It just indicate than the requested resource has not been changed since the last time it was requested and cached. If for some reason you change your .css or .js files but you don't see the changes reflected in the browser, you can refresh the page with Ctrl + F5. It will avoid cached resource and ask them from the server again.

You can configure if the resource are cached or not.

I recommed you take a look to the Django's docs for this topic.

Gocht
  • 9,924
  • 3
  • 42
  • 81