dev-master
9999999-dev https://github.com/PsukheDelos/queuedjobs-pdf-export/Export PDFs using QueuedJobs
BSD-3-Clause
The Requires
by Glen Peek
jobs export silverstripe pdf cwp
Export PDFs using QueuedJobs
Glen Peek, (*1)
By default, this job starts at the first page and produces PDFs in batches of 20, (*2)
If you would like to create a custom job, enter the desired batch size as the first parameter and the Page ID of the page you'd like the job to start on as the second parameter., (*3)
In the example below, we have specified to run the job in batches of 42 starting at Page 1024. , (*4)
This module requires that pdf_export is enabled. For example, you may include in your config.yml:, (*5)
BasePage: pdf_export: 1
Currently, only works with themes that are self contained (e.g. in one folder). For instance, the default CWP theme does not work as it relies on a separate folder for bootstrap styling., (*6)
The master branch of this module is currently aiming for SilverStripe 3.x compatibility, (*7)
The Queued Jobs PDF Export module provides a process for exporting all Live Pages to PDF., (*8)
By default, when PDF export is enabled on a CWP site, a download PDF link is added to all BasePages. The first time this link is hit, a PDF is generated of the page and then served to the user. On subsequent requests, the already generated PDF is served to the user instead of regenerating the PDF., (*9)
However, it was discovered that this was causing some CWP instances to overload. Bots crawling the web would happen upon a CWP site. They would then go about hitting every path they could. In doing so, they would hit the generatePDF function of every page in a short space of time. As many pages across the site had not had PDFs generated, this would cause the CWP instance to overload as it would now have to generate countless PDFs., (*10)
This was designed to prevent PDF Generation from overloading CWP instances by pushing generation of PDFs out to QueuedJobs to be run during off peak hours. This would ensure that all pages had a cached, pre-generated PDF available for download., (*11)
At present, this module would be run every so often on off peak hours. Ideally, the Export PDF Job would be run once over a website to generate all PDFs initially. BasePage could then be modified to published a new PDF every time it is updated / published., (*12)
Export PDFs using QueuedJobs
BSD-3-Clause
jobs export silverstripe pdf cwp