How do we measure our application performance?
How can we optimize our application?
This presentation covers *backend* and *frontend* with a focus on Ruby on Rails.
file storage web service (e.g. S3) • Use content delivery network (e.g. CloudFront) Create an S3 bucket and a CloudFront instance that points to the bucket. Use the asset_sync gem. Set config.action_controller.asset_host.
fonts and svg, you have to set Access-Control-Allow-Origin '.*\.[svg|woff|ttf|eot]' => { 'Access-Control-Allow-Origin' => '*', cache_control: "public, max-age=#{ 1.month.to_i }", expires: nil }, # Everything else, set cache-control to max-age 1 month '.*' => { cache_control: "public, max-age=#{ 1.month.to_i }", expires: nil } } asset_sync • Set CacheControl (time in seconds the client is allowed to cache the resource). Don’t use Expires (future date) • Set Access-Control-Allow-Origin for fonts and SVG
• Enable gzip_compression • S3 will deliver compressed version if GET request includes `Accept-Encoding: gzip` Both, the original and gzipped version will be synced to S3.
module CarrierWave::MiniMagick def optimize manipulate! do |img| img.strip img.interlace(“Plane”) # makes image progressive if JPG img.quality(90) img = yield(img) if block_given? img end end end # in ImageUploader version :preview do process :optimize end Thumbnails should be stored as baseline and not as progressive JPGs.