-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only add redirects if not already in place #132
Comments
One more comment, I'd love to help facilitate this, but I'm not a java person. Also this isn't really a problem when you have 5-10 redirects, but I'm migrating a website and my redirect list is upwards of 1500. |
s3_website always applies the redirects for performance reasons. If s3_website would like to know whether a redirect already exist on S3, it would have to perform one extra HTTP request for each configured redirect. In your case, this would mean 1500 extra HTTP request. I agree with you that the console output on redirect applications is annoying, especially if you have plenty of redirects. We could print the redirect application messages only when the user pushes the |
Interesting. How does s3_website know not to push files that haven't changed? Erik
|
@laurilehmijoki I'm assuming s3_website knows not to push a file because of the listing it gets from s3. Wouldn't it make more sense to compare a list of redirects to that same listing where size is 0, and only modify if they don't match? |
You are right, s3_website uses GetBucket for determining the deltas. Your idea is interesting. We could start treating zero-length objects as redirect objects. Do any nasty corner cases come into your mind? |
As long as s3 website is the only thing deploying to the bucket it should be a problem. There could be a config option to turn it off or on, I would really appreciate this feature, if I can help anyway, please let me know. |
Okay, so let's add an option for expressing the intent "skip redirect application if the length of the object is zero". Would you find the option Once that setting is on, the user needs to use |
I find that acceptable. However it might be nice to also have a —force-redirects only option? Just a thought? If not I’m fine with the —force option, either way this will be an awesome feature. Thank you.
|
I just released the version 2.7.0 where you can use the |
I created a new issue on the |
I will test today/tomorrow and let you know. Thanks for this! |
Tested and works great. Thanks! |
s3_website does a great job of only pushing new pages, assets, etc that have changed or don't exist. Even does a good job deleting old files, but everytime it runs it re-applies every redirect from the config. It would be nice for it to only apply it if it doesn't already exist.
The text was updated successfully, but these errors were encountered: