You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Dan Vassallo
dannyvassallo
Front End Engineer II @aws |
Former Adjunct Instructor & TA @RutgersCodingBootcamp | Former SDM, SDE, & FEE @Vydia
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Crop and resize an image using MiniMagick in Ruby on Rails. Two approaches.
This file contains 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 characters
Serving Rails Static Assets on Heroku using a CDN with gzip and cache control
Optimizing Rails Static Assets on Heroku Cedar
Serving Rails static assets is hard, especially on Heroku Cedar where Heroku forces Rails to serve static assets itself (which isn't particularly performant nor worth your dyno-dollar)---this is different than Heroku Bamboo which used Varnish and is no more. To make the best of the situation, I highly recomend:
Using the Heroku-Deflater gem which will selectively gzips assets (it gzips text-based files; and excludes images or binary files, which can actually be bigger when gzipped)
Configure your production environment to set cache-control headers and get out of denial about how static assets are being served on Heroku Cedar
Use AWS Cloudfront (or a CDN of your choosing) to serve the assets. Cloudfront is great because you can use the same Distribution
This file contains 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 characters