Closed cole-dda closed 1 month ago
🐣 Is your feature request related to a problem? Please describe.
for static files, maybe store gz file on other location or dynamic generate
💡 Describe the solution you'd like
web_fileresponse.py
def my_gz_handler(request): filename = request.match_info['filename'] return '/mygz/a.txt.gz' app.router.add_static(prefix,path,gz_handler=my_gz_handler) class FileResponse: def __init__(filepath,chunk_size,gz_handler=None): pass async def prepare(self,request): ... if self.gz_handler: gz_filename = self.gz_handler(request)
❓ Describe alternatives you've considered
Now,I must copy web_fileresponse.py,and rewrite gzip part code
I vote against. Serving static files is a nginx task.
It's not clear precisely what you're asking for, but maybe the changes in #8063 or similar do what you're looking for.
🐣 Is your feature request related to a problem? Please describe.
for static files, maybe store gz file on other location or dynamic generate
💡 Describe the solution you'd like
web_fileresponse.py
❓ Describe alternatives you've considered
Now,I must copy web_fileresponse.py,and rewrite gzip part code