why and where we have to write header cache control?
Date : March 29 2020, 07:55 AM
I hope this helps you . where we have to write these lines of codes? on the page where we do databse dealing or just any php pages?
|
Anyone else experiencing aws-s3 timeout problems when looking for nonexistant keys? S3Object.exist? and S3Object.request
Date : March 29 2020, 07:55 AM
help you fix your problem aws-s3 gem does not set the timeout to reasonable values You can do it by monkeypatching its create_connection method # Sets the timeouts to appropriate values for S3
module AWS
module S3
class Connection #:nodoc:
private
def create_connection_with_timeout_settings
http = create_connection_without_timeout_settings
http.open_timeout = 1
http.read_timeout = 5
http
end
alias_method_chain :create_connection, :timeout_settings
end
end
end
|
How can I cache to 1 minute with S3 and CloudFront and Write-S3Object
Date : March 29 2020, 07:55 AM
Does that help Here's a nice primer for the Cache-Control header. You need the header to look like this*: Cache-Control: public,max-age=60
-HeaderCollection @{"Cache-Control" = "public,max-age=60"}
Cache-Control: no-cache
Cache-Control: max-age=60,must-revalidate
|
How can I set cache-control using Write-S3Object with S3 and Cloudfront Distributions?
Date : March 29 2020, 07:55 AM
wish help you to fix your issue You need to use the -Metadata parameter in your query, changing your -HeaderCollection @{"Cache-Control" = "public,max-age=120"} parameter to -Metadata @{"Cache-Control" = "public,max-age=120"} works fine, and can be seen in AWS web console. Here is working snippet Write-S3Object -BucketName myBucket -file "test.json" -Metadata
@{"Cache-Control" = "public,max-age=120"}
PS C:\Users\DanielH1> Get-AWSPowerShellVersion
AWS Tools for Windows PowerShell
Version 3.1.5.1
Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Amazon Web Services SDK for .NET
Version 3.1.0.2
Copyright 2009-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Release notes: https://aws.amazon.com/releasenotes/PowerShell
This software includes third party software subject to the following copyrights:
- Logging from log4net, Apache License
[http://logging.apache.org/log4net/license.html]
|
Is it safe to return an ResponseEntity<InputStreamResource> that wraps S3Object.getObjectContent() in REST control
Date : March 29 2020, 07:55 AM
hope this fix your issue After some research I found the answer, that should be applicable to my question. Tl;dr version: Spring MVC handles the closing of the given input stream, so my approach described above should be safe.
|