Right now every time you reload the page a new compilation job is created. It uses the cached wasm file, but it does create a new directory, etc. To reduce redundancy I propose:
In browser local storage, keep a mapping (stan file hash) -> job ID. So when it comes time to compile, the client checks this table and checks for the existence of the wasm file. If it exists, then it uses that. If not, then it removes the entry in the table and proceeds as before.
Right now every time you reload the page a new compilation job is created. It uses the cached wasm file, but it does create a new directory, etc. To reduce redundancy I propose:
In browser local storage, keep a mapping (stan file hash) -> job ID. So when it comes time to compile, the client checks this table and checks for the existence of the wasm file. If it exists, then it uses that. If not, then it removes the entry in the table and proceeds as before.