I have hosted a static HTML website hosted on aws s3 using the Udemy video tutorial Amazon Web Services (AWS) Certified 2018 - 4 Certifications.
I have successfully hosted the website, however when I attempted to update the site by changing the some text in the index.html file and then uploading the new index.html to S3, I do not see my updates. Rather, I see the original webpage content. Occasionally, I am able to refresh the page or close my Chrome browser in order to see my changes, however it is not stable. Please help!
It sounds like your browser is caching the content.
If you open a different browser (eg Firefox) and the content has updated, then everything is fine on S3. It's just a matter of clearing your browser cache or waiting for the cached content to expire.
Related
So I have a website hosted on AWS S3 with added SSL protocol https://calc2burn.pl. I have added a Google Tag Manager scripts to the index.html file, but when I'm clicking preview on GTM site I receive message that it can't connect to website.
After clicking preview the Tag Manager opens up site in a new tab but nothing more happens. I've added my code correctly. I've been searching for solution for last 15 hours. I thought that maybe it's a problem with CloudFare and have modified script as instructed but that didn't help.
The weirdest thing is that once for 100 attempts to reconnect I've received a massage that it has connected to website but the actual Tag Manager account site showed that it's not connected.
Ok, so obviously the old version of index.html was still in CDN cache. I had to invalidate all files in the CloudFront distribution. I have found all helpful information on this site.
I have a react app installed in AWS s3. And I am serving the content using AWS CloudFront.
I have made some changes in the app and did invalidation in the CloudFront. It is serving updated content in all browsers excpet Google Chrome. Google Chrome loads the page with the old content.
Could you please let me know why it's happening?
Thank You.
Can you please check if your caching is managed on the cloudfront level or the client level?
Did you try to clear the browser cache? Because if your caching is being handled on the client level then clearing the browser cache should show you the updated content.
I have set up an S3 bucket on AWS where I upload my sensitive ‘media’ files from my Django DRF + React app. The files are not public. I use boto3 and Django-storages for that and the upload process works fine. I can also download the files for report generation from backend to return PDF response.
I would now like to display those files one by one from frontend. It seems like I now have two options:
Create a route in Django API/urls to handle media requests and point the app to the media directory. This way, the AWS login is handled by the backend server. This seems to beat the point of using a CDN as all media requests would go via the backend server?
Incorporate login credentials to React front end. This seems insecure.
What would be the recommended way to achieve this? I can’t seem to find the required information.
Thank you.
When a user upload a photo as a post it shows correctly on a home page but after sometime when user re-visit the website all photos that he\she posted do not show properly , i don't know whats the problem ?
How can i solve it ?
You can not store uploaded file (image) in Heroku. These will be lost when you restart or redeploy Heroku. If you want to support upload feature in your project, you can use Amazon S3 to to that. And you can use this library django-storages
My web application will host full size photos on Amazon S3 and we use S3 as our media server. We also allow the users to download the full-size photos. Our web server is on a different hosting company. On our web application, how can we force a File Download dialog box instead of showing the photo in browser directly from an Amazon S3 URL? For example, the image url could be "http://my.s3.amazonaws.com/12345.jpg"
One solution would be to download the image to our web server which is running Django, and then force a file download dialog, but will cost double bandwidth and double the download time as well.
Thanks!
See if you can get S3 to specify the content type of the files as application/octet-stream.
I have just verified this. In the AWS management console you can select a file, click on Properties, select the Metadata tab and then set the Content-Type to "binary/octet-stream". If it's e.g. image/jpeg it will display in the browser. If it's changed to binary/octet-stream it forces the browser to download it instead.