Ok, let me 1st come clean. I mistakenly added a 365d expiration date to my index.html
file. I've now made a change to a JS file, which changed the name of the import in my index.html
and now it's trying to import the wrong file. Oops.
So I'm thinking let's change the name of the default file name to something else that isn't cached.
What I have now
In my Angular project, I've changed all the building settings so now my index.html
file is named main.html
. The even the file itself is named main.html
, and checking in my dist folder, there is no index.html
only a main.html
.
I have hosted the site on Google App Engine and this is the command I used to deploy after building.
gcloud app deploy app.yaml --quiet --project=<project-name>
Here is my app.yaml
api_version: 1
env: standard
runtime: python27
service: <service-name>
threadsafe: yes
handlers:
- url: /(.*\.(css|eot|gz|html|ico|js|map|png|jpg|jpeg|svg|ttf|woff|woff2|pdf|gif))
static_files: dist/browser/\1
upload: dist/browser/(.*\.(css|eot|gz|html|ico|js|map|png|jpg|jpeg|svg|ttf|woff|woff2|pdf|gif))
expiration: "365d"
- url: /.*
static_files: dist/browser/main.html
upload: dist/browser/main.html
secure: always
expiration: "0s"
skip_files:
## bunch of files
Problem:
It seems like Google is still serving up index.html
, though to be honest I'm not really sure how to check. How do tell it to serve up the main.html
as the default file?
Edit 1
When I visit www.my-domain.com
it still serves up the old index.html
. But when I go to the <project>.appspot.com
(the google URL) which I haven't been to and I'm guessing neither has anyone else in quite some time, (not cached) it works.
It seems like Changing the name of the index.html
doesn't matter to the cache providers only that they are GETing data from /
. I have asked another related question about redirecting to another URL /
=> app
(Redirect base `/` path to folder in Google App Engine)
Edit 2
Using the technique here (https://www.maxlaumeister.com/blog/how-to-use-google-app-engine-as-a-free-redirect-server/) I was able to get a redirect working so when the user loads /
the server redirects to /app/
. This works great, for the uncached appspot.com
url. My custom domain still doesn't work.
I'm pretty sure some middle man (ISP or Tier 1 provider) is cacheing the entire GET request to /
. Not just index.html
or the server response to /
I'm not sure what other ideas I have. Are there any other ways to bust this caching?