17

I have a CSS code that generates http 304:

[08/Nov/2011 15:22:07] "GET /site_media/logo1.gif HTTP/1.1" 304 0

How can I get a workaround using the Django test server? Any clues?

Best Regards,

André
  • 24,706
  • 43
  • 121
  • 178
  • 1
    Seems to be duplicate to http://stackoverflow.com/questions/2730274/how-to-prevent-http-304-in-django-test-server – Lycha Nov 08 '11 at 21:20

2 Answers2

28

The 304 code is not an error. You don't need a workaround. It simply means that the static file has not changed since your browser last accessed it

For more information see the Wikipedia explanation of 3xx status codes.

Timmy O'Mahony
  • 53,000
  • 18
  • 155
  • 177
Alasdair
  • 298,606
  • 55
  • 578
  • 516
7

If you're getting 304 with files you did change, you can force reloading in your browser by checking "Disable cache" in your browser's dev tools (on Chrome/ium, right click on webpage -> inspect element -> go to network tab -> disable cache)

e18r
  • 7,578
  • 4
  • 45
  • 40
  • 1
    thanks for that answer, was struggling for couple of hours to get css/js reloaded) – midori Dec 12 '16 at 17:49
  • is there anyway that we apply these force with coding, i try some way like adding no-cache header or using no-cache decorator but this way has not any impact on js or css files ... – Lord ST May 13 '17 at 08:32
  • @LordST do you need it for production? That's not such a good idea because it would make your web app slower. See this: http://stackoverflow.com/q/6460967/2430274 – e18r May 16 '17 at 13:17
  • @emisilva I found storage.ManifestStaticFilesStorage class in django itself, I think that's what i want, i working on it right now ... – Lord ST May 16 '17 at 20:45