documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Load static assets uncached and purge automation

Open rachelwhitton opened this issue 3 years ago • 5 comments

Summary

Caching: Advanced Topics Address a common pain point that frequently adds tension and confusion in early stages of the customer journey

  • provide example custom script for loading uncached static assets
  • provide example quicksilver script to auto purge after a given workflow such as deploy
  • [ ] Todo: consider inclusion of additional QS example script that uses pantheon_clear_edge_all(); combined with passthru('drush cc all'); to achieve purging all caches automatically after deploying to live env (vs purging 1 file alone via pantheon_clear_edge_paths)

Attribution for the example scripts should go to @kyletaylored (thank you so much Kyle!)

cc @joebortelpantheon

Post Launch

Do not remove - To be completed by the docs team upon merge:

  • [ ] Redirect /docs/old-path/ => /docs/new-path/ (if applicable)
  • [ ] Include/exclude pages ^ respectively within docs search service provider (if applicable)
  • [ ] For Heroes - add a props post to the discussion board.
  • [ ] Remove from the project board

rachelwhitton avatar Dec 03 '21 17:12 rachelwhitton

Lighthouse Audit Results:

Description Live pr-6892 Difference
Performance Score 59 50 -9
Best Practice Score 79 79 0
SEO Score 96 96 0
Accessibility Score 96 96 0

Lighthouse Audit Reports:

Preview Environment

pantheondocs avatar Dec 03 '21 17:12 pantheondocs

todo: consider inclusion of additional QS example script that uses pantheon_clear_edge_all(); combined with passthru('drush cc all'); to achieve purging all caches automatically after deploying to live env (vs purging 1 file alone via pantheon_clear_edge_paths)

rachelwhitton avatar Dec 03 '21 18:12 rachelwhitton

Consider including an example that purges a given static asset manually on the fly w/Terminus, for example

terminus drush SITENAME.ENV -- eval "pantheon_clear_edge_paths(['/path/to/file.json'])"

rachelwhitton avatar Dec 29 '21 22:12 rachelwhitton

The Drush and WP-CLI workarounds are worth publishing in our docs. We get asked this question by developers often enough.

ccharlton avatar Jul 15 '22 18:07 ccharlton

A example of the WP-CLI version would be terminus wp pantheon cache purge-path <PATH>

ccharlton avatar Jul 15 '22 18:07 ccharlton