Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
any news about caching support via view cache? Actually if I enable it in the view I receive the pdf as expected the first time but a pdf containing a single empty page next time
Comments
Comment #1
mrfree CreditAttribution: mrfree commentedI forgot to say... I can enable "Query results" without problem, is the "Rendered output" cache option that breaks things
Comment #2
hunziker CreditAttribution: hunziker commentedCurrently I m fighting with stabilizing of the module. I need to this later. The rendered output cache cant work, because this works on the HTML layer, but we are above this. A potential approach could be to store the PDF object in a cache and load it later. But at the moment I have no time to implement this.
Comment #3
sachbearbeiter CreditAttribution: sachbearbeiter commentedsub
Comment #4
kerasai CreditAttribution: kerasai commentedAny update on this? Generating these PDFs is a huge load on a server. Anything with much traffic is likely to have issues.
Comment #5
lsolesen CreditAttribution: lsolesen commentedComment #6
killua99 CreditAttribution: killua99 commentedFor the next version caching will be supported.
If you want to add more info about witch caching system you're using. Because I'm thinking in the normal caching drupal system.
Comment #7
killua99 CreditAttribution: killua99 commentedAdding tagging next version.
Comment #8
kerasai CreditAttribution: kerasai commentedI haven't really thought this through, just throwing ideas out. Maybe something like D6's Imagecache module or D7's core Image system may be a good model to base this on.
Comment #9
candelas CreditAttribution: candelas commentedmaybe i dont undertand, because of that i ask :)
do you mean to create the pdf when it is called and the saving it?
that sounds interesting for the use case of a magazine, where you create the pdf when a user needs it.
though, this should be an option, in my opinion, because there is other use case: invoices. if you want to send the pdf by email after the product is sent, you need to save it to the server with rules (it is working already).
maybe, in the magazine example, it could be done by a rule that checks if the pdf exists and if not, it creates. what do you think?
by the way, @mrfree, @sachbearbeiter and @kerasai, which is your use case?
would you like to collaborate to betatest, develop or document this feature? :)
Comment #10
candelas CreditAttribution: candelas commentedor making a cron task? since you say it is a huge load on the server (i imagine a magazine with 50 pages), then to act as image cache will not avoid that. if it is a cron task, you can see the moments where your server can run it better...
Comment #11
kerasai CreditAttribution: kerasai commentedIn response to my suggestion in #8:
This is not a simple problem, so there's probably not a simple answer. In a very vague way, this is how it would need to work:
Generate and save the PDF:
Let this happen when the user requests it. So that means when an HTTP request is made to the path/file, not when a link to it is rendered in a page. D7 Image system does this, and it wouldn't be incredibly difficult to build something that works similarly.
HTTP request to sites/default/files/viewspdf/[subdirs/filename]
Considerations that come to my mind
Invalidate stale PDFs:
Determine when the content of that PDF has changed and purge appropriate cached files.
Comment #12
candelas CreditAttribution: candelas commented@kerasai very good and fast reply :)
Generate and save the PDF:
2 cases depending the size of the pdf: in my case 1 or 2 pages that doesnt load the server, while in a magazine that i made, there where sometimes 80 pages and then it was a problem... in this last case is where i recommend cron to make the task in an hour that you see correct.
image cache can be good for a site with many articles that change often, but if you have a big pdf, like the weekly magazine as a whole, the problem keeps being the load on the server.
Invalidate stale PDFs:
not always important, since in an invoice, there are not changes.
Comment #13
killua99 CreditAttribution: killua99 commentedComment #14
killua99 CreditAttribution: killua99 commented