Open mitchelljkotler opened 8 years ago
I am sorry for not responding sooner. Thought I would be, as author, automatically notified about every issue that is opened. Turns out that's not true.
I agree that this would be a good optimisation to have. I see few possible problems though. First, one is that server still needs to wait for result so it can save it wherever it is configured to store it. Even if I took care of saving myself, that still cannot happen before processing is done, but even if I create a subprocess to handle it, I am left with two options. Either detach it completely and have no idea if it succeeded or not, or risk being killed if webserver's process gets recreated with again questionable result.
Will think about possible solutions and I am always open to suggestions :)
I worked around this by using django-queued-storage to run the optimization in a celery task. Maybe it would be useful to add an option in to run the optimizations in a celery task without needing another library?
Sounds interesting. Would love to see how it is implemented.
Regretfully my sporadic replies are not just me being bad with communication, but chronic lack of time so it will probably be awhile before I can work on this.
I would like an option to run the compression commands asynchronously (should be able to do this with subprocess Popen) so that the webserver does not need to wait for these commands to run. Having the webserver wait for IO operations is generally not a good idea, as you want the browser to return as quickly as possible. Having the optimizations run in the background should be fine.