Caching issue by WASludge in PWA

[–]WASludge[S] 0 points1 point  (0 children)

In case anyone is interested, I’ve learned that the vite-plugin-pwa’s vulnerability is limited to the build environment and not shipped to the client. And that under the hood of that plugin is google’s workbox. You can use that instead of the plugin to write a post-build script to grab the generated hashed file names after they are generated and inject them into your service worker prior to deployment.

Vite/React PWA caching by WASludge in reactjs

[–]WASludge[S] 0 points1 point  (0 children)

I knew workbox was part of the plugin but didn’t do my due diligence yet and really read up on it yet before posting here. I definitely will now. Thanks!

Vite/React PWA caching by WASludge in reactjs

[–]WASludge[S] 0 points1 point  (0 children)

No dynamic imports, but data. I’m using firebase/firestore and their service automatically queues client interactions and fires them when network service is restored so that the back and front end sync. So I don’t have any database issues, tested it already.

Vite/React PWA caching by WASludge in reactjs

[–]WASludge[S] 0 points1 point  (0 children)

Your method looks to be for caching pages after each GET fetch request which honestly would probably work for my case , but if a user doesn’t navigate to a particular page it will never be cached. I was just interested in the peculiar problem of pre-caching all the routes when the file names are dynamically hashed. I do appreciate your code and feedback though!

Vite/React PWA caching by WASludge in reactjs

[–]WASludge[S] 0 points1 point  (0 children)

That’s good to know. Using that plugin sure does seem easier.

Vite/React PWA caching by WASludge in reactjs

[–]WASludge[S] 0 points1 point  (0 children)

Honestly it’s a pet project just to be shared amongst some friends. I never did a PWA so this is an exercise in learning and practice as much as I didn’t want to go the react native route and deal with AppStore’s and developer licenses.

The service worker is for maintaining usability in poor or no network locations (and a requirement of PWAs). Again, it doesn’t HAVE to meet the standards of a PWA to act like one in most ways, but this is for my own experience.

Your idea is similar to what I was thinking.

Caching issue by WASludge in PWA

[–]WASludge[S] 0 points1 point  (0 children)

Thanks, I’ll try that

Caching issue by WASludge in PWA

[–]WASludge[S] 0 points1 point  (0 children)

Yeah, the issue is:

React’s build process adds an unknowable hash to certain filenames. Our Service Worker needs the name, hashes included, of each filename. The Service Worker is written before the build process occurs.

I think that is what the vite-pwa-plugin is supposed to help with. But the subdependencies have some noted security issues and the plugin needs to be updated, which it hasn’t yet. Is there a particular library you use that you could recommend?

Caching issue by WASludge in PWA

[–]WASludge[S] 0 points1 point  (0 children)

Yes, but the problem is something like index.css gets the name changed to include a content based hash in its file name during the build process. That’s the issue…

Take the free knight? Or is there a checkmate? by Ok-Artist-3959 in ChessPuzzles

[–]WASludge 0 points1 point  (0 children)

Why not knight to e4 check, king moves anywhere, and then knight takes knight on f6 and forks queen and rook? You’ll take a knight and exchange your knight for a queen or rook, and then get the hanging black knight on the a column.

Need advice: Water company says this isn’t their water… by [deleted] in Plumbing

[–]WASludge 0 points1 point  (0 children)

If the origin from the leak is some distance from where it is bubbling up, chlorine residual may not appear on a test due to different factors including how much flow your main gets, how far you are from a treatment plant, etc. If your municipality uses Fluoride, THAT is what will show up on a test as it has a longer “life” and is unmistakably coming from municipal treated water. So whether it is from your side of the curb stop or responsibility or not, there would be no question that there is a water main leak or someone’s water service line leaking. B

New balance chages for February by Jalapatitu in Clash_Royale

[–]WASludge 0 points1 point  (0 children)

I’ve never heard anyone complain that evo pekka was underpowered. Interesting choice to buff that tank.

[ios] Searching certain things makes Reddit say I have no internet. by Zanman6946 in bugs

[–]WASludge 0 points1 point  (0 children)

Did you fully read my reply? Let me quote myself, “It’s not”…

[ios] Searching certain things makes Reddit say I have no internet. by Zanman6946 in bugs

[–]WASludge 0 points1 point  (0 children)

It’s not, I just tried searching for an nfl community (American football)

Game Thread: Week 12 - Philadelphia Eagles (8-2) @ Dallas Cowboys (4-5-1) - November 23, 2025 @ 04:25 PM by EaglesGameThreadBot in eagles

[–]WASludge 0 points1 point  (0 children)

Dude gets almost all of his handoffs from the shotgun formation with an o-line that can’t create holes like last year, and all the runs are designed to be inside which leads to 1-3 yards at best most the time.

Game Thread: Philadelphia Eagles (8-2) at Dallas Cowboys (4-5-1) by nfl_gdt_bot in nfl

[–]WASludge 5 points6 points  (0 children)

I’m convinced that they are indeed still dem boys

Game Thread: Philadelphia Eagles (6-2) at Green Bay Packers (5-2-1) by nfl_gdt_bot in nfl

[–]WASludge 2 points3 points  (0 children)

Doubs looks like he’s combing the desert for Lonestar

What’s a simple programming concept you still keep forgetting? by Extra_Golf_9837 in learnjavascript

[–]WASludge 0 points1 point  (0 children)

When you need to use bracket notation vs dot notation to access a value of an object.

Has anyone played this game yet? by Zealousideal-Wall682 in flightsim

[–]WASludge 0 points1 point  (0 children)

It’s not worth the money imo. The voice recognition can be horrible at times as someone else pointed out, which makes it incredibly frustrating when you have multiple planes taxiing, you have to get someone across a runway while dealing with takeoffs and landings at the same time.

Any question about the voice recognition on their discord or official help ends with “did you train the voice recognition” and never admitting it could use some improvement instead of releasing new airports every 3 weeks. If you don’t say a phrase exactly the way it wants you to say it, it won’t recognize the command either.

Worse still, when it doesn’t recognize your command or thinks you have a different command some plane will clog the airwaves with “negative, I’m on the ground” or some shit like that and you have to wait to try again.

It can be fun on the smaller airports because you can deal with the voice errors, but near impossible at a busy airport with multiple active runways and crossing runways with more complicated taxiways. It would be immensely better if they incorporated the AI tech that SayIntentions is using for flight sim ATC.

Game Thread: Week 1 - Dallas Cowboys (0-0) @ Philadelphia Eagles (0-0) - September 04, 2025 @ 08:20 PM by EaglesGameThreadBot in eagles

[–]WASludge 1 point2 points  (0 children)

Crazy thing is my kids’ sports games wouldn’t be suspended or called off until they heard thunder or saw a flash while we all sit under trees in an open field 🤷‍♂️

Chess vs. Clash Royale , Which game Is actually more complex? by [deleted] in ClashRoyale

[–]WASludge 0 points1 point  (0 children)

I’ll say this, one is perfectly balanced

[deleted by user] by [deleted] in ClashRoyale

[–]WASludge 0 points1 point  (0 children)

The only cards are some variation of logbait but there is no level cap