Skip to content

Commit caf4acc

Browse files
author
Daniel Thielking
committed
Added cache buster script.
1 parent eb43f70 commit caf4acc

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

workbench/cache_buster.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import requests as req
2+
from time import sleep
3+
import sys
4+
5+
bust_url = ''
6+
bust_range = 100000 # Count of request to target
7+
bust_sleep = 50 # Sleep time in ms
8+
9+
for bust in range(0, bust_range):
10+
try:
11+
str_bust = str(bust)
12+
req_url = bust_url
13+
req_url += "?u=" + str_bust
14+
req_url += "&ac=" + str_bust
15+
req_url += "&as=" + str_bust
16+
res = req.get(req_url)
17+
except req.exceptions.MissingSchema as ex:
18+
print("bust_url must contain schema.\n One of http:// or https://")
19+
sys.exit(127)
20+
else:
21+
print("Bust Request: {}".format(req_url))
22+
print("Bust Response: {}".format(res.json()))
23+
sleep(bust_sleep/1000)

0 commit comments

Comments
 (0)