3
1
Fork
You've already forked experimental-plugins
1

cache_busting: Various enhancements #44

Merged
volpeon merged 2 commits from main into main 2026年02月01日 21:25:56 +01:00
volpeon commented 2026年01月31日 12:35:01 +01:00 (Migrated from github.com)
Copy link

This PR makes the following changes to the cache_busting plugin:

  • Handle URLs with fragments. These are a common occurrence when working with SVG sprites.
  • Add an option applyToCSS (off by default) which makes the plugin process all url() URLs encountered in CSS code. This allows web fonts to be cache busted, for instance.
  • Clear the hash cache when Lume updates the website during development. This is necessary since otherwise files won't get renamed at all and the browser may display a broken or stale version of the website.
This PR makes the following changes to the cache_busting plugin: - Handle URLs with fragments. These are a common occurrence when working with SVG sprites. - Add an option `applyToCSS` (off by default) which makes the plugin process all `url()` URLs encountered in CSS code. This allows web fonts to be cache busted, for instance. - Clear the hash cache when Lume updates the website during development. This is necessary since otherwise files won't get renamed at all and the browser may display a broken or stale version of the website.

Thank you!
Instead of the applyToCSS option, I think it's better to use a query parameter in the url, in order to make this feature opt-in in the same way that HTML does with attributes.
This also align better with how the inline plugin works.
What do you think?

Thank you! Instead of the `applyToCSS` option, I think it's better to use a query parameter in the url, in order to make this feature opt-in in the same way that HTML does with attributes. This also align better with [how the `inline` plugin works](https://lume.land/plugins/inline/#inline-in-css). What do you think?
volpeon commented 2026年01月31日 20:07:29 +01:00 (Migrated from github.com)
Copy link

@oscarotero Oh, this solution is way better! I didn't like how my option was an all-or-nothing deal, but it didn't occur to me to use a query parameter. I'll update my code accordingly

@oscarotero Oh, this solution is way better! I didn't like how my option was an all-or-nothing deal, but it didn't occur to me to use a query parameter. I'll update my code accordingly

thank you!

thank you!
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lume/experimental-plugins!44
Reference in a new issue
lume/experimental-plugins
No description provided.
Delete branch "main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?