Skip to content

Commit

Permalink
Remove need for opaque caching
Browse files Browse the repository at this point in the history
  • Loading branch information
lucienimmink committed Jun 12, 2024
1 parent c094b93 commit 499862a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/components/album-art/album-art.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export class AlbumArt extends LitElement {
: ''} ${this.loading && !this.isDefault ? 'loading' : ''}"
width="${this.dimension}"
height="${this.dimension}"
crossorigin="anonymous"
/>
`;
}
Expand Down
1 change: 1 addition & 0 deletions src/components/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export class HomeNav extends LitElement {
class="album-art"
alt="${track.artist['#text']}${track.name}"
@error="${(e: Event) => this._onError(e)}"
crossorigin="anonymous"
/>
${track.loved === '1'
? html`<span class="heart">${heartIcon}</span>`
Expand Down
2 changes: 1 addition & 1 deletion src/utils/colour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function getDominantColorByURL(url: any, cb: any): any {
},
false,
);
clone.src = `${url}#no-sw-cache`;
clone.src = `${url}`;
}
export function getColorsFromRGBWithBGColor(rgba: any, bgColor: string): any {
const text = getReadableColor(rgba, bgColor);
Expand Down
9 changes: 4 additions & 5 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default defineConfig(({ mode }) => {
maxAgeSeconds: 60 * 60 * 24 * 1,
},
cacheableResponse: {
statuses: [0, 200],
statuses: [200],
},
broadcastUpdate: {
options: {
Expand All @@ -181,8 +181,7 @@ export default defineConfig(({ mode }) => {
},
},
{
urlPattern:
/.*\/listen.*$|.*\/rescan.*$|.*#no-sw-cache$|.*ts=.*$/,
urlPattern: /.*\/listen.*$|.*\/rescan.*$|.*ts=.*$/,
handler: 'NetworkOnly',
},
{
Expand All @@ -208,7 +207,7 @@ export default defineConfig(({ mode }) => {
maxAgeSeconds: 60 * 60 * 24 * 365,
},
cacheableResponse: {
statuses: [0, 200],
statuses: [200],
},
},
},
Expand All @@ -222,7 +221,7 @@ export default defineConfig(({ mode }) => {
maxAgeSeconds: 60 * 60 * 24 * 7,
},
cacheableResponse: {
statuses: [0, 200],
statuses: [200],
},
},
},
Expand Down

0 comments on commit 499862a

Please sign in to comment.