“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  can we use JavaScript function inside jinja2 for loop block

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 *

Top 5 Most Expensive Domains Ever Sold 4 Must-Try ChatGPT Alternatives: Perplexity AI, BardAI, Pi, and More! Types of Trading Techniques in the Stock Market. ChatGPT app now available in India this AI chatbot can help you make your life more productive. What is wrong with following function code?