perf: static file fast path + remove info() log on every request
- Add fast path in processorResource._handle() for static assets (.js/.css/.png/.jpg/.gif/.ico/.svg/.woff etc) Static files skip auth closures, i18n, url2processor, isHtml overhead - Remove info() call in checkAuth() middleware that logged on EVERY request (was causing disk flush on every request, blocking the async event loop) - Log output now only uses debug() for timecost, exception() for errors
This commit is contained in:
parent
8efae163b8
commit
574ef00881
BIN
ahserver/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/auth_api.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/auth_api.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/baseProcessor.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/baseProcessor.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/configuredServer.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/configuredServer.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/dsProcessor.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/dsProcessor.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/error.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/error.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/filedownload.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/filedownload.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/filestorage.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/filestorage.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/filetest.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/filetest.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/functionProcessor.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/functionProcessor.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/globalEnv.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/globalEnv.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/llmProcessor.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/llmProcessor.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/llm_client.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/llm_client.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/loadplugins.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/loadplugins.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/myTE.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/myTE.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/processorResource.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/processorResource.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/proxyProcessor.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/proxyProcessor.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/real_ip.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/real_ip.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/restful.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/restful.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/serverenv.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/serverenv.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/sqldsProcessor.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/sqldsProcessor.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/uriop.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/uriop.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/url2file.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/url2file.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/utils.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/utils.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/websocketProcessor.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/websocketProcessor.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/xlsxData.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/xlsxData.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/xlsxdsProcessor.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/xlsxdsProcessor.cpython-310.pyc
Normal file
Binary file not shown.
BIN
ahserver/__pycache__/xtermProcessor.cpython-310.pyc
Normal file
BIN
ahserver/__pycache__/xtermProcessor.cpython-310.pyc
Normal file
Binary file not shown.
@ -163,7 +163,6 @@ class AuthAPI:
|
||||
|
||||
@web.middleware
|
||||
async def checkAuth(self,request, handler):
|
||||
info(f'checkAuth() called ... {request.path=}, {request.method}, {type(handler)}')
|
||||
t1 = time.time()
|
||||
path = request.path
|
||||
userinfo = await get_session_userinfo(request)
|
||||
|
||||
@ -202,6 +202,15 @@ class ProcessorResource(StaticResource,Url2File):
|
||||
|
||||
|
||||
async def _handle(self,request:Request) -> StreamResponse:
|
||||
# Fast path for static assets: skip auth closures, i18n, url2processor, isHtml
|
||||
static_exts = ('.js', '.css', '.png', '.jpg', '.jpeg', '.gif', '.ico',
|
||||
'.svg', '.woff', '.woff2', '.ttf', '.eot', '.map',
|
||||
'.webp', '.bmp', '.mp3', '.mp4', '.webm', '.ogg', '.wav')
|
||||
path_lower = request.path.lower()
|
||||
if any(path_lower.endswith(ext) for ext in static_exts):
|
||||
self.parse_request(request)
|
||||
return await super()._handle(request)
|
||||
|
||||
clientkeys = {
|
||||
"iPhone":"iphone",
|
||||
"iPad":"ipad",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user