Im working on a symfony2 project with sonata admin bundle.
I have a large pdf with images to generate after form input and writing to database. I start the pdf generation at the end of persisting data. Afterward the user get redirected.
My plan: I wanna trigger the pdf generation after persisting the data into database. But the redirect is waiting for the pdf document is ready. That takes to long. So the redirect should be done and at the same time the pdf generation should be triggered an running in background.
If the pdf is created successfully a notice message should appear in the header.
PDF-Generation is done with DOMPDF. So it's done directly done in php and not with separate command line tool.
Someone any ideas how to implement this?
I'm thinking about an ajax request after the redirect is done. Is that a good approach?