“GET /static/styles.css HTTP/1.1” 304 Flask Web Development

Share

The message “GET /static/styles.css HTTP/1.1″ 304” that you’re seeing in your terminal is an HTTP response message that is being generated by your web server. It indicates that the browser has requested the file “styles.css” from the “/static” directory, and the server has responded with a “304 Not Modified” status code.

The 304 status code means that the browser has a cached version of the file and the file has not been modified since it was last requested. Therefore, the browser will use the cached version of the file instead of requesting a new copy from the server. This is a feature of HTTP caching, which is used to improve the performance of web pages by reducing the amount of data that needs to be transferred over the network.

This is not an error or an issue, it is a normal behavior. If you make any changes to the CSS file, you should clear the browser cache to see the changes.

Related  what is difference between request.form.get() and request.args.get()

Additionally, you can also try to add a query parameter like a timestamp to the file URL to force the browser to load the new version of the file like :

<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css') }}?v=1">

This will cause the browser to treat the file as a new one and request it from the server, the browser will not use the cached version.


Share

Leave a Reply

Your email address will not be published. Required fields are marked *