appengine randomly serves old files - google-app-engine

I'm currently using Google Appengine to host a website with Golang as the backend. I have a custom domain setup and (sometimes) it works perfectly fine. My website requires some css and js files from the server. These were served perfectly in the past but now it randomly stops working. Both on the "mydomain.de" and on the "myapp.appspot.com" domains. Sometimes it works on the normal domain and then it works on the other and sometimes even on both. But if I reload the site after a couple of minutes it just shows me an old index.html file (that I have removed days ago).
Did someone experience this problem in the past and does anyone know a fix for this?
Thanks in advance.

Have you ruled out your browser cache as the source of the problem? If after getting a stale version, shift-reload (assuming Chrome or Firefox) brings up the desired version, then look into how to do "cache busting" for css and js, and check the app.yaml doc for how to set expiration times on static assets (assuming your index.html is static).

Related

React app get stuck on reload on Firefox desktop, but not on Chrome and other browsers

I have a create-react-app build being served by flask. It works fine in other browsers; however on Firefox, when I do a reload, the main.js file is stuck at the fetch method. After 3 minutes, it timesout then renders what it suppose to. I am looking for guidance on where to look from hereon. The production server does not log that the endpoint is receiving the fetch request; however, once the 3 minutes is up, the client side renders the updated information (as if it hit the server side). Everything looks like it should be working in the code I wrote, but I am not able scope out where I should be looking in debugging this issue.
Note: I am giving a broad description of the problem at the moment, but will disclose specifics such as codes, logs, and others items once I am able to get some guidance of the matter. As of now, there are no resources pointing out this specific issue, thus displaying code will simply be a "garbage" dump.
After working on the problem for quite some time, we found these two articles to be very helpful:
https://www.andreasreiterer.at/fix-whitescreen-static-react-app/
https://blog.miguelgrinberg.com/post/how-to-deploy-a-react--flask-project
After testing different sources, we first found that article one's suggestion of changing the homepage to the base url worked. After realizing that the nginx was getting confused on which static files to server, we proceeded to follow article 2's steps.
We did not have any issues on other browsers, but only on firefox. I hope this will help those that are experiencing the same Firefox issue.

Firebase Deployment: My web appear in "project.firebaseapp.com" but not "project.web.app"

I've completely deployed my website with Firebase CLI, and project.firebaseapp.com is accessible and works fine. However, project.web.app keeps showing "Site Not Found".
I'm building my web app with React and already set the folder to "build"
Edit1: I've tried safari, chrome, incognito of both, and also hard refresh and empty cache still showing SITE NOT FOUND.
Edit2: It's working on Line Application Built-in Browser (mobile), but not on Chrome (mobile).
Edit3: Sent the domain to my friends around the world and found out that it's not working for only people living in South East Asia.
As I mentioned in comments, try any other browser. Both the domains are working on my computer. It might just take some time for both to deploy and update the cache.
It's usually better to ask someone who stays far from you and maybe has a different ISP to test update website. I sometimes use Lighthouse and it turns up even it won't show up on my computer. (Apparently the older version gets cached).
I'd recommend disabling cache from network tab in browser console when in development stage:

How to find which file is serving ads in my application?

Ok, somehow I am serving ads in my NodeJS / AngularJS application, but I haven't include this myself.
There's some package or included link sending ads to the client, but the ads are not visible, and the adserve url changes with every request. (The url that can be seen in the screenshot below)
How do I find out which place in my application serves these ads?
PS: I am sure this doesn't come from my local dev pc, my other collegues have this issue as well.
A quick trick may be to search for the url in every files of your repository. If you use a cdn to load your librairies, try to look inside also (you can do that directly in chrome dev tool with ctrl/cmd f in the sources tab).
Hope it will help !
The "adserver" in my project turns out to be a tracking / analytics beacon included by the Realtime.co framework.
Thankfully, the author responded to my email very quickly, and they also provide a beacon-free version of their framework. So problem solved :)

Angular and cloudfront with Safari

We've setup an angularjs application on cloudfront which has all asset files on s3 storage and from there used via cloudfront for SSL and performance.
We have an identical setup to what is described in this guide
https://rossfairbanks.com/2015/01/30/integrating-angular-s3-cloudfront.html
As we used same post to create our own setup, it seems though that this works on all browsers except Safari.
On Safari, when visiting a url directly on a given path or refreshing any sub pages, the ui-router would redirect user page to landing page.
For staging though, we have same setup but running directly on S3 without CloudFront in middle hence no SSL. but, yet it seems to work even on Safari
so, problem seem to be an issue with CloudFront and Safari to be more specific.
Can anyone advise on what could be the cause? and how we can solve it?
UPDATE: This issue might be related to this bug https://bugs.webkit.org/show_bug.cgi?id=24175
Angular on AWS (Cloudfront/S3) for Safari
I figured out that you need to use https in order Safari to refresh correctly. You can tell S3 to redirect to https protocol and the problem gets solved:
<Redirect>
<Protocol>https</Protocol>
<HostName>test.example.com</HostName>
<ReplaceKeyPrefixWith>#!/</ReplaceKeyPrefixWith>
</Redirect>
I had this problem a ton but not this specific issue. Safari which affects desktop and mobile/tablet devices does have this quirk. In many instances I was able to change it to a query parameter when I know it is going to be going through a redirect. It is a frustrating issue that has been going on for months.

SmartGWT - Appengine - 404 not found

Im using smartGWT v2.1 with GWT 2 and Appengine SDK 1.3.0
On localhost, everything works fine!
When I deploy everything goes fine too, without any error!
The problem is, when i access the the app it returns an blank screen. Using the firebug i saw just nocache.js missing.
ErrorLog:
GET mika.nocache.js
http://perfworker.appspot.com/Mika/mika.nocache.js
404 Not Found
perfworker.appspot.com
Just to know, the last version of smartGWT should work on AppEngine out of the box?
Thanks in advance!
Cleber
I'm going to guess you're developing on Windows. NTFS, unlike nearly every other filesystem, is case-insensitive, so it'll work fine if your file or directory has one capitalization and you're accessing it with another. On every other platform, however, including the one App Engine runs on, capitalization matters: Check that you're using the same capitalization to access the file as is used to name the file.
Btw, this not only applies to SmartGwt, but to any GWT app. I would have voted on the answer above, but I don't have enough rep points yet [new user]. Changing the casing of the link in the base html page worked for me.

Resources