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

feat: add cache buster #243

Merged
merged 8 commits into from
Sep 9, 2024
Merged

feat: add cache buster #243

merged 8 commits into from
Sep 9, 2024

Conversation

dylandepass
Copy link
Member

@dylandepass dylandepass commented Sep 4, 2024

fixes: #216

Experience should be

Gdrive/sharepoint -> preview (cacheBust)
Reload on preview (no cache bust.. instead cache: reload
Publish on preview (cacheBust)
Publish on publish (no cache bust.. instead cache: reload

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.94%. Comparing base (6c9d4cb) to head (d5e4d77).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #243   +/-   ##
=======================================
  Coverage   99.94%   99.94%           
=======================================
  Files          52       52           
  Lines        1938     1946    +8     
=======================================
+ Hits         1937     1945    +8     
  Misses          1        1           

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

@dylandepass dylandepass marked this pull request as draft September 4, 2024 18:41
/**
* Removes the cache buster from the URL.
*/
function removeCacheParam() {
Copy link
Member Author

Choose a reason for hiding this comment

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

Don't love this defined here but didn't think it fit into any other util files and didn't want to create another one (to keep the number of files the sidekick loads to a minimum). Do you see this fitting anywhere else?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't particularly mind having this here, but maybe tab.js would be a better fit. We could call it from checkTab().

Copy link
Member Author

Choose a reason for hiding this comment

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

Since removeCacheParam() uses window we can't call it from checkTab unfortunately. Since you don't mind, I'm thinking I will just keep it where it is.

@dylandepass dylandepass marked this pull request as ready for review September 4, 2024 20:51
@@ -962,15 +962,6 @@ export class AppStore {
// update live
const resp = await this.api.updateLive(path);
if (resp) {
// bust client cache for live and production
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't believe any of this was doing anything unless it just so happened that the publish happened same origin. This logic is instead moved to the publish plugin.

@dylandepass dylandepass requested a review from rofe September 4, 2024 20:52
src/extension/app/store/app.js Outdated Show resolved Hide resolved
@dylandepass dylandepass merged commit 63a7dc5 into main Sep 9, 2024
6 checks passed
@dylandepass dylandepass deleted the cache-buster branch September 9, 2024 14:30
rofe pushed a commit that referenced this pull request Sep 9, 2024
# [1.31.0](v1.30.2...v1.31.0) (2024-09-09)

### Features

* add cache buster ([#243](#243)) ([63a7dc5](63a7dc5))
@trieloff
Copy link

trieloff commented Sep 9, 2024

🎉 This PR is included in version 1.31.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Implement cache buster
3 participants