However pdf2up will always give the same names, so we can precompute the output paths, so we don't need to wait for the processing to run to get the paths so we can check if the paths already exist before trying to create them.
This therefore means that we can skip (re)computing images altogether if the lambda has already been run for them (within the bucket lifecycle policy time period) and therefore give an instant result in the browser.
In this way we can provide nice features (like #1) that generate a short-term 'gallery' of papers that is turned over daily.
Currently the image filenames are calculated based on the output of
pdf2up.conversion.pdf2png
https://github.com/lmmx/pdf2uplambda/blob/b0854c2d80fad15947b1caba0e8976153274d64a/pdf2up_lambda/lambda_function.py#L42
However
pdf2up
will always give the same names, so we can precompute the output paths, so we don't need to wait for the processing to run to get the paths so we can check if the paths already exist before trying to create them.This therefore means that we can skip (re)computing images altogether if the lambda has already been run for them (within the bucket lifecycle policy time period) and therefore give an instant result in the browser.
In this way we can provide nice features (like #1) that generate a short-term 'gallery' of papers that is turned over daily.