documentation
documentation copied to clipboard
Load static assets uncached and purge automation
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
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:
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)
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'])"
The Drush and WP-CLI workarounds are worth publishing in our docs. We get asked this question by developers often enough.
A example of the WP-CLI version would be terminus wp pantheon cache purge-path <PATH>