mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 01:08:43 +02:00
dev: Make the serve-docs command uncached
This commit is contained in:
parent
42a7676d5a
commit
4d874f6c11
2 changed files with 18 additions and 3 deletions
16
flake-modules/dev/server.py
Normal file
16
flake-modules/dev/server.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import http.server
|
||||
|
||||
PORT = 8000
|
||||
|
||||
|
||||
class UncachedHTTPHandler(http.server.SimpleHTTPRequestHandler):
|
||||
def end_headers(self):
|
||||
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
self.send_header("Pragma", "no-cache")
|
||||
self.send_header("Expires", "0")
|
||||
super().end_headers()
|
||||
|
||||
|
||||
with http.server.HTTPServer(("", PORT), UncachedHTTPHandler) as httpd:
|
||||
print(f"Serving documentation at http://localhost:{PORT}")
|
||||
httpd.serve_forever()
|
Loading…
Add table
Add a link
Reference in a new issue