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.

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

报告相同问题?

悬赏问题

  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app