Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF Cache #1540

Closed
wants to merge 13 commits into from
Closed

PDF Cache #1540

wants to merge 13 commits into from

Conversation

jakejackson1
Copy link
Member

@jakejackson1 jakejackson1 commented Jun 13, 2024

Description

WIP.

PR to resolve #1539

Notes to self:

  1. How to handle auto-cache purging when template is updated? Relevant Improve Template Caching #1527

Testing instructions

Screenshots

Checklist:

  • I've tested the code.
  • My code is easy to read, follow, and understand
  • My code follows the accessibility standards.
  • My code has proper inline documentation / docblocks.

Additional Comments

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 68.68327% with 88 lines in your changes missing coverage. Please review.

Project coverage is 73.81%. Comparing base (73750a2) to head (9aaf361).
Report is 2 commits behind head on development.

Files Patch % Lines
src/Model/Model_PDF.php 62.71% 44 Missing ⚠️
src/Controller/Controller_PDF.php 76.00% 12 Missing ⚠️
src/Statics/Debug.php 0.00% 12 Missing ⚠️
src/Model/Model_Install.php 50.00% 10 Missing ⚠️
src/View/View_PDF.php 80.95% 4 Missing ⚠️
src/Helper/Helper_Misc.php 92.59% 2 Missing ⚠️
src/Statics/Cache.php 91.66% 2 Missing ⚠️
src/Controller/Controller_Pdf_Queue.php 0.00% 1 Missing ⚠️
src/Controller/Controller_Upgrade_Routines.php 50.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development    #1540      +/-   ##
===============================================
- Coverage        76.07%   73.81%   -2.27%     
===============================================
  Files              248      193      -55     
  Lines            12993    11620    -1373     
  Branches           370        0     -370     
===============================================
- Hits              9885     8577    -1308     
+ Misses            3100     3043      -57     
+ Partials             8        0       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jakejackson1 jakejackson1 force-pushed the pdf-cache branch 2 times, most recently from 0b1033e to 52b541f Compare July 17, 2024 06:15
*
* @since 6.11.0
*/
public function queue_cleanup_task( $form, $entry ) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakejackson1 re-add and deprecate.

@@ -874,13 +880,9 @@ protected function load_html( $args = [] ) {
*/
protected function maybe_display_raw_html( $html ) {

/* @TODO - move to shared file */
Copy link
Member Author

@jakejackson1 jakejackson1 Jul 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakejackson1 make you use rgget( 'html' ) && Debug::is_enabled_and_can_view()

$settings = $this->apply_backwards_compatibility_filters( $settings, $entry );
/*
* Normalize the PDF action
* The PDF cache introduced in 6.12 relies on a hash generated from the form, entry, and pdf settings
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakejackson1 Add more info about editing the form, entry or PDF settings auto-expires a PDF so the document is always fresh.

api.php Outdated
*
* @since 6.12
*/
public static function get_pdf_filename( $entry_id, $pdf_id, bool $include_extension ) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakejackson1 move to another PR. Not required here.

Will also add an API for getting the field markup for a PDF.

*/
class Cache {

protected static $template_tmp_location = null;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakejackson1 add docblocks


/**
* @since 6.12.0
* @TODO
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakejackson1 add docblocks

@jakejackson1
Copy link
Member Author

Superseded by #1556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Caching - add clear cache tool + dev mode bypass
1 participant