mirror of
https://github.com/sys-nyx/red-arch.git
synced 2025-05-06 16:55:17 -04:00
added a simple python http server to prevent caching from serving modified files
This commit is contained in:
parent
2fcf0fc5bb
commit
a1c5bb5ac1
1 changed files with 15 additions and 0 deletions
15
r/testsrv.py
Normal file
15
r/testsrv.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import http.server
|
||||||
|
|
||||||
|
class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
|
||||||
|
def end_headers(self):
|
||||||
|
self.send_my_headers()
|
||||||
|
http.server.SimpleHTTPRequestHandler.end_headers(self)
|
||||||
|
|
||||||
|
def send_my_headers(self):
|
||||||
|
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
self.send_header("Pragma", "no-cache")
|
||||||
|
self.send_header("Expires", "0")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
http.server.test(HandlerClass=MyHTTPRequestHandler)
|
Loading…
Add table
Add a link
Reference in a new issue