mirror of
https://github.com/izzy2lost/izzy2lost.com.git
synced 2026-06-19 01:16:11 -07:00
16 lines
522 B
Python
16 lines
522 B
Python
import http.server
|
|
import socketserver
|
|
|
|
PORT = 5500
|
|
|
|
class NoCacheHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
|
|
def end_headers(self):
|
|
self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
|
|
self.send_header('Pragma', 'no-cache')
|
|
self.send_header('Expires', '0')
|
|
super().end_headers()
|
|
|
|
with socketserver.TCPServer(("", PORT), NoCacheHTTPRequestHandler) as httpd:
|
|
print(f"Server running at http://localhost:{PORT}/")
|
|
httpd.serve_forever()
|