Server Side Script cached answers?

Hello,
I ve wrote my first server side script.
I change the same script every time
At first i had a mistake in my script.
Than i had a simple pong script running
then I request all issues from erpnext
and at last i ve done a custom sql query.

And now every time I make an API request, I got an different answer. It looks like frappe is caching the answerse and sending them back

this are my answers, I change nothing, I just recall the API with a python script

user@host:~# ./test1.py
<Response [200]>
200
{“message”:}
user@host:~# ./test1.py
<Response [200]>
200
{“message”:“pong”}
user@host:~# ./test1.py
<Response [500]>
500
{“exception”:“TypeError: not enough arguments for format string”,“exc_type”:“TypeError”,“_exc_source”:“helloworld (app)”,“exc”:“["Traceback (most recent call last):\n File \"apps/frappe/frappe/app.py\", line 110, in application\n response = frappe.api.handle(request)\n File \"apps/frappe/frappe/api/init.py\", line 49, in handle\n data = endpoint(**arguments)\n File \"apps/frappe/frappe/api/v1.py\", line 36, in handle_rpc_call\n return frappe.handler.handle()\n File \"apps/frappe/frappe/handler.py\", line 49, in handle\n data = execute_cmd(cmd)\n File \"apps/frappe/frappe/handler.py\", line 85, in execute_cmd\n return frappe.call(method, **frappe.form_dict)\n File \"apps/frappe/frappe/init.py\", line 1715, in call\n return fn(*args, **newargs)\n File \"apps/frappe/frappe/utils/typing_validations.py\", line 31, in wrapper\n return func(*args, **kwargs)\n File \"apps/helloworld/helloworld/api.py\", line 7, in ping\n data = frappe.db.sql(f\"select parent from tabContact Phone where phone like ‘%{number}%’\",as_dict=1)\n File \"apps/frappe/frappe/database/database.py\", line 217, in sql\n self._cursor.execute(query, values)\n File \"env/lib/python3.10/site-packages/pymysql/cursors.py\", line 151, in execute\n query = self.mogrify(query, args)\n File \"env/lib/python3.10/site-packages/pymysql/cursors.py\", line 129, in mogrify\n query = query % self._escape_args(args, conn)\nTypeError: not enough arguments for format string\n"]”}
user@host:~# ./test1.py
<Response [500]>
500
{“exception”:“TypeError: not enough arguments for format string”,“exc_type”:“TypeError”,“_exc_source”:“helloworld (app)”,“exc”:“["Traceback (most recent call last):\n File \"apps/frappe/frappe/app.py\", line 110, in application\n response = frappe.api.handle(request)\n File \"apps/frappe/frappe/api/init.py\", line 49, in handle\n data = endpoint(**arguments)\n File \"apps/frappe/frappe/api/v1.py\", line 36, in handle_rpc_call\n return frappe.handler.handle()\n File \"apps/frappe/frappe/handler.py\", line 49, in handle\n data = execute_cmd(cmd)\n File \"apps/frappe/frappe/handler.py\", line 85, in execute_cmd\n return frappe.call(method, **frappe.form_dict)\n File \"apps/frappe/frappe/init.py\", line 1715, in call\n return fn(*args, **newargs)\n File \"apps/frappe/frappe/utils/typing_validations.py\", line 31, in wrapper\n return func(*args, **kwargs)\n File \"apps/helloworld/helloworld/api.py\", line 7, in ping\n data = frappe.db.sql(f\"select parent from tabContact Phone where phone like ‘%{number}%’\",as_dict=1)\n File \"apps/frappe/frappe/database/database.py\", line 217, in sql\n self._cursor.execute(query, values)\n File \"env/lib/python3.10/site-packages/pymysql/cursors.py\", line 151, in execute\n query = self.mogrify(query, args)\n File \"env/lib/python3.10/site-packages/pymysql/cursors.py\", line 129, in mogrify\n query = query % self._escape_args(args, conn)\nTypeError: not enough arguments for format string\n"]”}
user@host:~# ./test1.py
<Response [200]>
200
{“message”:}
user@host:~# ./test1.py
<Response [200]>
200
{“message”:}
user@host:~# ./test1.py
<Response [200]>
200
{“message”:}
user@host:~# ./test1.py
<Response [200]>
200
{“message”:“pong”}
user@host:~# ./test1.py
<Response [200]>
200
{“message”:[{“name”:“ISS-2024-00030”},{“name”:“ISS-2024-00029”}]}

I ve create a new api endpoint and now I get the correct answers

this is my pyhton script

headers = {
“Authorization”: f"Token {api_token}",
“Content-Type”: “application/json”,
“Cache-Control”: “no-cache”,
“Pragma”: “no-cache”
}
r = requests.get(“http://server/api/method/helloworld.api.ping”,headers=headers)
print(r)
print(r.status_code)
print(r.text)

i also tried

bench --site sitename clear-cache

maybe somebody can tell me what’s the problem