Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeping static files open #93

Open
Changaco opened this issue May 24, 2021 · 0 comments
Open

Keeping static files open #93

Changaco opened this issue May 24, 2021 · 0 comments

Comments

@Changaco
Copy link
Member

Aspen currently supports keeping the contents of static files in RAM (the store_static_files_in_ram setting). I think it should also support keeping open file descriptors instead. It would be a middle ground alternative that improves performance and reliability compared to opening the files over and over, without wasting RAM like store_static_files_in_ram does.

The performance problem of opening the files over and over is that we have to call os.path.realpath() every time to check that the file isn't outside the allowed directories. That function is slow because it has to make a system call for every parent directory (and because it's written in pure Python, but it would still be slowish if it was written in C).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant