Installed PWA keeps connecting to the old server after DNS update - progressive-web-apps

My domain wheelofnames.com used to point to a web app hosted on Google App Engine. I made the app a Progressive Web App (PWA) using Workbox. Two days ago I moved the app to Firebase Hosting, which meant I had to update the DNS record for my domain.
Today, users visiting wheelofnames.com from a web browser get their content served from Firebase Hosting. This is as expected, as the DNS record for that domain points to Firebase Hosting. Perfect!
But before the DNS update, I installed the PWA version of the app on my Android device. When I open that PWA today, it requests content from App Engine, even though the DNS record for wheelofnames.com doesn't point there any more. Checking the App Engine log, I see other users having the same experience.
How does one get the PWA to follow the DNS record and request content from the new environment instead of the old? Do PWAs cache DNS data somehow?

The Cache Storage API (which Workbox uses under the hood) uses request URLs as keys, and Response objects as values.
While DNS resolution is important when making the requests to populate the caches initially, once a Response has been saved, reading the response and using it later on happens without regard to DNS resolution.
It sounds like you might need to kick off a new build for your web app and give Workbox's precaching a chance to pick up the changes to any updated files, which would be the case any time you make changes to precached content, irrespective of what host is used "under the hood". Also not that because precached content is shown in a cache-first manner, you may end up seeing previously cached content immediately when you revisit a site, and it's not until the next visit (after all tabs have been closed) that you'd see the fresh content.
There are UX patterns that can allow users to opt-in to seeing new content immediately, as described in this recipe.

Related

How does one get around the firebase hosting proof of ownership catch 22?

Firebase hosting requires that a TXT setting be set up to as they call it
Prove the domain is yours
I purchased a domain. It is mine. In order to set this TXT setting I have to have the domain hosted. The place I purchased the domain from sells hosting for minimum one year at a time. What is the point of firebase hosting when I have to buy hosting somewhere in order to prove that the domain is mine? Is there any way to get around this catch 22?
Proving ownership is done by putting a TXT record in the DNS. This doesn't require that you have a website hosted yet, it merely requires access to the DNS settings for your domain.
It's hard to help beyond that without knowing where you registered your domain.
Update. I took Frank's advice and set up a few Namecheap accounts. Wowie! The discount names are as cheap as 50 cents/year if you buy 1 or 5 years. Thanx for the advice. There is a caveat to using Namecheap/firebase, however.
Do not take this as if I were looking a gift horse in the mouth. I am super grateful to Google for free hosting. I merely want to warn users that firebase is not a free country. Google forces the s religion. I put in many hours of work to create my website using my girlfriend's hosting MySQL. Her hosting platform does not have an s in the URL: https. So the Angular 5 HTTP calls barf. I also included a contact page and a share via email popup. I used my girlfriend's hosting and set up a poor man's PHP web service for that. That does not work because girlfriend's hosting uses HTTP not https. So now I have to go back and recode these backend connections to use Google firebase and Google functions/SendGrid. I could have done that from the get-go and saved myself the time and aggravation.

Redirect my weebly site to my heroku app

I recently acquired a domain while buying a logo and some business cards through logomaker.com. I took this opportunity to claim the domain that I want to use for my rails app on heroku (Was this a mistake?).
Currently I seem to be required to use Weebly to edit the site for this new domain (But I'm thinking about transferring the domain to my GoDaddy account for simplicity. Is this a good idea?) I'm trying to route the simple domain to my rails app. In other words, I want users to be able to type mrzschool.com and get routed to mrzschool.herokuapp.com. I haven't been able to find a way to do this through Weebly.
I also have access to DNS and nameserver settings, such as imap and pop, through logomaker.com. This seems like it might be a way to change the routing, but I'm realizing that I'm unschooled in the realm of domains and DNS.
I'd suggest you go through the the process of moving your domain registrar from logomaker to your goDaddy account, were you can keep an eye on this domain along side any other domains you've there. It's a tedious process but worth it in my opinion. However, it's optional since you have all the control you need to do that via logomaker.
The heroku docs mentions (found here) how you can point your own custom domain to your heroku app subdomain. Keep in mind that you will need to verify your account and your ownership of the domain.
You will also find some useful troubleshooting steps here.

How can I show a maintenance page when my web server is down or completely powered off?

I work for a company which has its own web server they are due to have a complete power blackout over the weekend, meaning their servers will be down.
Does anyone know a way we could present a down status on a maintenance page or some kind of redirect so we can at least inform our users that the site is down for maintenance and not just missing/broken?
The best way is probably setting up a redirection to dummy server on your load balancer or border routers. If you have no such thing, then you can either try asking your provider about the options, or temporarily change the DNS record, provided that you reduce DNS cache timeouts before and after the change, so it takes effect immediately.
Set up a server on another location and point their domains DNS record to that server during the blackout.
The redirect has to be carried out by the web server. No web server, no redirect. What you can do is to get another web site by a web hosting company (which will not be subject to your blackout), and configure it to route requests from your main dns to the temp site with just a plain notice html page, then remove it once power is restored. This can be done if you have the dns info from the primary site. You could also mirror the site this way, and then shut down the mirror and no one will be the wiser. Try http://siteground.com I have used them for years.
If you are using a load balancer, see if it supports a "Sorry Server" page. Most of them have this feature built in.

How can I save my application now-oauth and HTTPS?

Well, I am a non-Facebook developer, and a normal .NET programmer who have created a Facebook application for a regular website around one year ago using FBML. I have no time to read the roadmap every day and know what will be next. So I had no idea about OAuth and HTTPS till yesterday.
All of a sudden I received an email yesterday saying (27 Sep) upgrade to OAuth 2.0 and HTTPS,
otherwise the application will be disabled from 1st Oct.
Now, I read about OAuth 2.0 the whole day yesterday, and think I can get around it now chaining things, but I found that the site which currently host my Facebook application doesn't have SSL (HTTPS support) or dedicated IP address and I found that I need to invest around 20$ to get SSL and another $20 for a dedicated IP address. I am ready to pay
for it, but as you know a response from hosting are not that quick.
Now I have emailed my hosting to make arrangement for it, but sadly they have not responded yet, and I now only have one day left (I don't know they will respond or not).
So how can I save my application? I don't have any server that support HTTPS for now. Even if I get some free SSL I am not able to implement it as I don't have a dedicated IP address.
Is there some way I can put a "will be back soon" kind of message. Or how can I save the application now?
I think I need to update that HTTPS canvas page in the setting anyhow.
FBML applications are not required to migrate and support HTTPS and signed requests.
Source: http://developers.facebook.com/blog/post/567/
Also, be aware that Facebook will stop supporting FBML apps at the end of the year.

Google Channel API - How to test it locally?

I want to test my application which share messages between two users using google channel api, but I manage to see messages going only from one side to the other.
is it because I'm opening 2 channels on the same machine? I am running the application on different browsers (Chrome and IE) and each one logged in with a different user name? shouldn't that be enough?
Any suggestion on how to test my application on a single PC, or must I connect another PC for such application?
Thanks
Muky.
You surely can test Google Channel API on a single machine. (I've done it, it works). Note that, when I run it on my local machine, I see the browser makes continuous requests (polling) although, when I upload it to Google App Engine, I only see push notifications. (You can check out the requests using Firebug in Firefox - in the NET tab). As far as I understand, Channel API is simulated in local mode using polling whereas, when uploaded to Google App Engine, they make use of Comet (not polling, rather long-lived requests).
I don't think your case was a browser issue. Each logged in user should open one channel. Then when you want to send a message to every users, you should send a message to each id that's logged in.