Development
Learn how to develop applications for Laravel Vapor.
Binary Responses
To return binary responses, such as PDF downloads, from your Vapor application, your HTTP response should include the X-Vapor-Base64-Encode
header:
Lambda limits responses to 6MB. If you need to serve a larger file, consider returning a signed, temporary S3 URL that your user may use to download the file directly from S3.
Configuring OpenSSL
To use certain OpenSSL functions such as openssl_pkey_new, you must create an openssl.cnf
configuration file and instruct Vapor to load it via the OPENSSL_CONF
environment variable. For example, this environment variable will instruct Vapor to load an openssl.cnf
file from the root of your project:
An example openssl.cnf
file is available below:
“After Response” Jobs
In typical Laravel applications, you may dispatch jobs that will be executed after the HTTP response is sent to the browser:
However, we recommend that you always dispatch jobs to your queue workers when using Vapor. Vapor is not able to execute a job after sending a response to the browser; therefore, attempting to do so will cause your application to appear slower to the end user.
Was this page helpful?