10

I'm building a web app. All the external links worked in my Project directory worked fine before but I noticed that yesterday every time I modify the .css file it didn't render this change at all. It actually is freezed with the same style regardless if I even erase the whole .css file content.

This is the response that I'm getting when I run flask:

 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger pin code: 230-950-485
127.0.0.1 - - [09/Mar/2017 17:53:09] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [09/Mar/2017 17:53:10] "GET /static/css/main.css HTTP/1.1" 200 -
127.0.0.1 - - [09/Mar/2017 17:53:10] "GET /static/js/main.js HTTP/1.1" 200 -
127.0.0.1 - - [09/Mar/2017 17:53:10] "GET /static/css/main.css HTTP/1.1" 304 -
127.0.0.1 - - [09/Mar/2017 17:53:14] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [09/Mar/2017 17:54:04] "GET / HTTP/1.1" 200 -

Notice the 304, seems like that might be the problem? I appreciate any advice in what steps to take.

tadm123
  • 8,294
  • 7
  • 28
  • 44

3 Answers3

15

In Flask this is very common, whether you use Internal or external files:

HTTP Response

304 NOT MODIFIED

A conditional GET or HEAD request has been received and would have resulted in a 200 OK response if it were not for the fact that the condition evaluated to false.

In other words, there is no need for the server to transfer a representation of the target resource because the request indicates that the client, which made the request conditional, already has a valid representation; the server is therefore redirecting the client to make use of that stored representation as if it were the payload of a 200 OK response.

This means Flask is telling the browser that it already has the content.

If you clear your browser cache and you will notice that Flask returns a 200 on your next request.

Community
  • 1
  • 1
2

Disabling cash solutions for this issue is not working for me. If it doesn't update the file because it already represented, it means if i have new code in my file, i will never be able to push these modifications

SystemX
  • 481
  • 4
  • 10
0

304 means you have compiled that file before and there are no modifications to the file. You can clear them by deleting cache file on pycache folder

Herahadi An
  • 198
  • 14