Last active
June 19, 2021 00:12
Revisions
-
schneems revised this gist
May 9, 2016 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,4 +33,8 @@ I appreciate the authors of the software and everything `asset_sync` has allowed ktksbye [@schneems](http://twitter.com/schneems) ## Comments Comments on gists don't send notifications. You're basically shouting into the ether :( -
schneems revised this gist
Sep 4, 2015 . No changes.There are no files selected for viewing
-
schneems revised this gist
Aug 5, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ A not politically correct assertion of my feelings towards a piece of software: **Note:** Repetition builds cynicism, `asset_sync` isn't bad, but when an asset problem cannot be solved via support it gets escalated to me. Often times someone using `asset_sync` the problem is due to their use of the library and not from Heroku. ## Backstory -
schneems revised this gist
Mar 5, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ A not politically correct assertion of my feelings towards a piece of software: ## Backstory The asset sync gem uploads your assets (images, css, javascript) to S3. From there you can either point browsers to the copy on S3 or use a CDN + the S3 bucket. It's a good idea, and solved a problem at one time. It is no longer needed and you should now use https://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn instead. So rather than copying your assets over to S3 after they are precompiled the CDN grabs them from your website instead. Here's some reasons why it's better. -
schneems revised this gist
Mar 5, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ I like Ruby, and I like Rails. The concept of keeping your code DRY is more than ### Deploy Determinism If I'm debugging on my app inside of a dyno `heroku run bash` and I run `rake assets:precompile` this doesn't just modify my local copy, it actually modifies the copy on S3 as well. This goes back to cannonical stores, it can be bad. All your assets are screwed up and you don't know why. The sync part of asset_sync can also fail if S3 is down, or there's a glitch in the network. What if you only write part of a file, or only half of your assets are synced. These things happen ### Do more with less -
schneems created this gist
Mar 5, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ A not politically correct assertion of my feelings towards a piece of software: **Note:** Repition builds cynicism, `asset_sync` isn't bad, but when an asset problem cannot be solved via support it gets escalated to me. Often times someone using `asset_sync` the problem is due to their use of the library and not from Heroku. ## Backstory The asset sync gem uploads your assets (images, css, javascript) to S3. From there you can either point browsers to the copy on S3 or use a CDN + the S3 bucket. It's a good idea, and in it's time was necessarry. It is no longer needed and you should now use https://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn instead. So rather than copying your assets over to S3 after they are precompiled the CDN grabs them from your website instead. Here's some reasons why it's better. ## Begin Rant ### Cannonical Assets I like Ruby, and I like Rails. The concept of keeping your code DRY is more than good practice it allows you to have single authoritive places of information. If you need to change that information you change it in one place and that's it. With `asset_sync` we're saying that although our "cannonical" copy of assets is in our source control, we're now relying on a 3rd party store of assets. What happens if someone has a failed deploy after assets get synced, what if someone modifies a file in the S3 bucket? Instead of fixing one copy of assets now you must fix two. ### Deploy Determinism If I'm debugging on my app inside of a dyno `heroku run bash` and I run `rake assets:precompile` this doesn't just modify my local copy, it actually modifies the copy on S3 as well. This goes back to cannonical stores, but it can be bad. All your assets are screwed up and you don't know why. The sync part of asset_sync can also fail if S3 is down, or there's a glitch in the network. What if you only write part of a file, or only half of your assets are synced. These things happen ### Do more with less Now that you can have a CDN dynamically grab assets from your website there is no reason to add an extra step into the process. You 100% should be using a CDN as Ruby is horrible for serving assets, and S3 is only slightly better. If I asked you to move a bag of cement from a car to a construction site, you probably wouldn't feel very much like carying it to virgina first. This is essentially what you're doing when you're using asset_sync. It's not a bad step, but it's not a necessarry step either. ## End Rant Using asset sync can cause failures, is difficult to debug, un-needed, and adds extra complexity. Don't use it. Instead use https://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn I appreciate the authors of the software and everything `asset_sync` has allowed developers to do in the past. Now it's not needed so please don't use it. ktksbye [@schneems](http://twitter.com/schneems)