One of the responsibilities of my Rails application is to create and maintain signed xmls. Any signed xml, after its creation, never changes. Therefore, I store each xml in the public folder and redirect the client appropriately to avoid unnecessary processing from the controller.
Now I want a new function: each xml is associated with a date, and I would like to implement the ability to serve a compressed file containing each xml whose date is in the period specified by the client. However, this period cannot be limited to less than one month for this feature to be useful, and this means that some mail files that will be served will be as large as 50M.
My application is deployed as a Passenger Apache module. Thus, it is completely unacceptable to serve the file with send_data , since the client will have to wait until the entire compressed file is created before the actual download begins. Although I have an idea on how to implement this function in Rails, so a compressed file is created during maintenance, I feel that my server will be poorer in resources, as soon as some long Ruby / Passenger processes are allocated to serve large zip files.
I read the best solution for serving static files through Apache, but not for dynamic ones.
So what is the solution to the problem? Do I need something like a custom Apache handler? How do I tell Apache from my application how to process a request, compress files and transfer the result at the same time?
apache zip streaming
Rรดmulo ceccon
source share