Expire create-react-app service worker cache from users browsers - create-react-app

I had previously created a website for my band on thescratch.ie using create-react-app and hosted this using S3 and Cloudfront. I recently replaced the react site using Shopify instead and thescratch.ie domain now points to Shopify.
For new users to the site, everything works fine but old users continue to see a broken cached version of the react website, not a Shopify site. I had assumed that the cache would eventually expire for these users, but it's been like this for a couple of months now.
Looking at the Chrome dev tools network panel I notice a couple of things:
Almost everything is being served from cache - the index.html and main.js return a 200 and have a size of (service worker)
Images return a 404
The manifest.json returns a 404
I'm wondering if there's a way to expire the service worker cache? Is it possible to do this by hosting a new manifest.json file on Shopify?
Thanks in advance.

I ran into the same issue in a combination of CRA & Gatsby.
Found this Gatsby plugin which helped me.
The underlying article maybe also can help you.
tl;dr in my understanding you need to place a service-worker.js in the root directory containing the code to unregister the old service worker.

Related

Upload file of Shopware PWA on server(Server Side Rendering)

Hii Can anyone help me to upload the Shopware PWA on the server(Server Side Rendering). I have tried almost all the methods mentioned on the nuxt js official website but I can't upload the PWA on the server. By using yarn generate, it converts the PWA on the static website so when I changed it on the backend it doesn't reflect on the PWA(like category, pages, etc) and also doesn't change the title of the website dynamically. and I have also tried this method https://www.niagahoster.co.id/blog/upload-nuxtjs-di-hosting/ but it also doesn't work for me.

How to make scribe generated css files use the https protocol of the whole website

I decided to use Scribe to make documentation of my api. So i generated the docs folder offline then i pushed it onto app platform.
Now when i load the page the page loads but the css files do not use the https protocol for the whole website.
I have tried checking on the Github repo to see if their anyother people with the same challenges but i do not seem to see that people are facing this issue.
I will be thankful for the help.
I tried to make changes of the scribe.php file in the config folder in my laravel project but it still refused.
I placed the base_url to be https:localhost before pushing but still getting the same error

Can not alter/add data on shopify paid plan store by unlisted public app

I am facing some weird issue in Shopify app development. I have created app which is working fine on Development store. it is able to add some data on development store.
But for testing purpose I have offered this app to the merchants to test this app on their live store having activated Shopify Paid plan. But app can not add any data. Post/Put requests are auto converted to Get requests.
I have created couple of apps those are published on App store and in past they were being used by Active Paid Plan merchants before app has been published without any issue.
Is there something changed on Shopify side. or I am missing something this time ?
Any help will be appreciated.
every put/post request's endpoint should be on .myshopify version of domain.
I was passing primary domain. and it was working fine in dev stores as dev store. because in dev stores .myshopify version domain and primary domains are same.
I did not get this issue for so long. it was a silly mistake but stops app functionality.
Posting answer just because other people would not make such a blunder.

Hosting a custom Angular App in the cumulocity

We are creating a custom Angular App which uses only the services of cumulocity and not any cumulocity based plugins.
If i host this app inside the cumulocity, the app will work or not.
Please clarify. We are needing answers for many question but we don't have until now.
Please help us to support Soon
Thanks
BA
After your comments i have created application folder which contains certain assets, index.html etc..
At the end i zipped and uploaded in the tenant. When i clicked the application it is going to 404 not found.
Attached the screen shot for your reference.
https://tempar.adamos.com/apps/custom-app/index.html
If your app has no relation to the plugin concept all you need is the application manifest in the ZIP file you are uploading (http://cumulocity.com/guides/web/introduction/).
Also ensure that on root level of the ZIP file there is the index.html

How to make reactjs serve static pages for SEO

I have this reactjs webapp - http://52.26.51.120/
It loads a single page and then you can click links to dynamically load other boards on the same page... such as 52.26.51.120/#/b, 52.26.51.120/#/g
Now the thing is, I want each of these to be an individual page, for the purpose of seo. I want you to be able to google "my-site.com g", and you will see the result 52.26.51.120/#/g. This obviously cant work if you are using reactjs and it is all on one page. Google will only render and cache that main page (can it even render that page? does google execute javascript?)
Even more specifically, id want something like my-site.com/g/1234 to load a thread. There could be a thousand threads every day, so im not sure how to handle that.
Are there any solutions to this? to allow react to possibly serve up static pages as html so that they can be cached on google? I am using expressjs and webpack as my server right now, and all the code is executed in jsx files.
Thanks
You can use Prerender.io service. In a nutshell you will need to connect your server app or web server with prerender service and do little setup (see documentation). After that search engines and crawlers will be served with a static (prerendered) content while users will get classic React.js (or any other single page) app.
There is a hosted service with free tier or open source version
I suspect you could do some smart configuration with nginx and it could convert a url of domain/board to a redirection of domain/#/board when detecting the user-agent as a bot instead of a typical user.