I'm using Jekyll and Amplify. I had a file under /file.html. I moved the file under /file/index.html so that it doesn't return a 404 for /file/. That part works fine.
However, after doing this, it seems that when I request my website with /file, I still get the old page (file.html) instead of being served the new path (/file/index.html).
I see during the deploy step that the step doesn't upload files if they already exists, so I'm suspecting that in my case it didn't delete/invalidate file.html and that this stay file means that my website answer for both /file and /file/ with a different page (instead of redirecting /file to /file/ as stated in the AWS Amplify documentation about redirects)
Hello @bvirlet. Thanks for reporting. Can you provide your app id and region?
@abhi7cr thanks for looking into this.
The app id is d3b21b977rb7wd (us-east-1).
The real name of the duplicate files would be enterprise.html and /enterprise/index.html. It looks like enterprise.html has been left instead of being deleted.
We're experiencing the same behavior. +1
When we deploy, we restore assets from the last 6 build artifacts. This is done to support serving of old assets. In addition, we have a set of rules through which we run the requested url:
In this case since foo.html still exists from the last 6 builds, it will be served by default.
We have added a feature request in our backlog which would enable customers to purge the old assets during a deploy. Meanwhile, there a couple of options to make it work from your side:
Let me know if that works.
PS: You can find more about the rules in the trailing slash and clean urls section:
https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
Thank you, @abhi7cr for this clear explanation. The 6 times information is helpful. Looking forward to this update.
When can we expect this feature? Hardcoding redirects and deploying 6x on every build contradict the concept of CI/CD...
Probably not surprising that I'm having the same issue with deleted content in a Hugo static site build; it takes 6 deployments before the deleted URL is purged from CloudFront.
I'm seeing the same thing intermittently with index pages generated during the Hugo build process except that changes aren't always reflected even after 6 deployments
content/blog/my-post.mdcontent/blog/new-post.mdmysite.com/blog/my-post has the correct new titlemysite.com/blog/new-post has been createdmysite.com/blog has the incorrect original title of the first post and is missing the second postmysite.com/blog has not been updatedUpdate: The CloudFront cache did eventually refresh but it took a while, maybe a couple hours, despite the 6 redeployments
I also wonder why this gets so little attention.
6 seems like a magic number to me. I'd rather consider this issue as a bug than a feature request.
Couldn't the caching be implemented more intelligent? Purging manually seems not like a solution to me.
Shall content creators always call the devs as soon they delete a page?
Wait this is a feature request? How is it not a bug with instant cache invalidation?
@joshkadis @ohlr just to be clear we do invalidate cache as referenced in that doc, however there is also an issue and I agree deploying six times in order to invalidate a removed file is not intuitive. This exists today in order to protect deployments for sites with micro frontends (for example). I will have the team take a deep dive on this and get an idea for when we can plan to have this resolved and this ticket will be updated accordingly.
@litwicki Thanks for the response, much appreciated!
@litwicki Hi, wanted to follow up to see if this is on the roadmap and if there is any update?
@litwicki any update on this ?
@rafikiass @drake-smith @joshkadis we've recently rolled out a new version of our deployment system via #115 that we are validating resolved this in all regions as well. We'll be following up with doc updates and confirmation ASAP.
Closing this as we have resolved with #115 -- in the event of any regression please recreate a new issue.
thanks @litwicki
@litwicki we're still seeing the problem on our website (arn:aws:amplify:us-east-1:324915367782:apps/d2zlsiaic5yx2j).
The https://geniusscansdk.com/docs/simple-scanner-guide/ folder doesn't exist anymore on our website and should return a 404, yet it still returns an old page.
@bvirlet when was your last deployment?
Our last deployment was a couple hours ago.
@bvirlet thanks, we're going to take a closer look at this
Most helpful comment
@joshkadis @ohlr just to be clear we do invalidate cache as referenced in that doc, however there is also an issue and I agree deploying six times in order to invalidate a removed file is not intuitive. This exists today in order to protect deployments for sites with micro frontends (for example). I will have the team take a deep dive on this and get an idea for when we can plan to have this resolved and this ticket will be updated accordingly.