dongqia3502 2017-10-13 13:27 采纳率: 100%
浏览 193
已采纳

如何在基于Laravel的应用程序中处理大量PDF生成并通过电子邮件发送它们

I'm just curious how would you handle a scenario where a lot of PDF's has to be generated on the server and be send to the user by email. You're not able to temper with the PDF because it needs to be 100% secure or close to that number.

For example the PDF contains the order you just made in a webshop, proof of purchase or something like that.

The application will have a lot of concurrent users. For this question I will use Laravel as a base platform for the web application.

I had the idea of running a cron job at night that will generate all this PDF's at once and send per e-mail.

What is considered best practise in this scenario?

  • 写回答

1条回答 默认 最新

  • doulu6929 2017-10-13 14:13
    关注

    For example the PDF contains the order you just made in a webshop, proof of purchase or something like that.

    Given that these will presumably occur throughout the day, a queue may be a better solution than a cron. Every time someone does an action that'd require a PDF, fire off a queue job. A background process will check for queued jobs and process them.

    This avoids having a giant backlog, protects you in the case a cron fails, and gets PDFs out to the clients in a more timely fashion.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?