cloudfront_asset_host 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -1,21 +1,40 @@
1
1
  # CloudFront AssetHost
2
2
 
3
- Easy deployment of your assets on CloudFront or S3. When enabled in production, your assets will be served from Cloudfront/S3 which will result in a speedier front-end.
3
+ Easy deployment of your assets on CloudFront or S3. When enabled in production, your assets will be served from CloudFront/S3 which will result in a speedier front-end.
4
+
5
+ ## Why?
6
+
7
+ Hosting your assets on CloudFront ensures minimum latency for all your visitors. But deploying your assets requires some additional management that this gem provides.
8
+
9
+ ### Expiration
10
+
11
+ The best way to expire your assets on CloudFront is to upload the asset to a new unique url. The gem will calculate the MD5-hash of the asset and incorporate that into the URL.
12
+
13
+ ### Efficient uploading
14
+
15
+ By using the MD5-hash we can easily determined which assets aren't uploaded yet. This speeds up the deployment considerably.
16
+
17
+ ### Compressed assets
18
+
19
+ CloudFront will not serve compressed assets automatically. To counter this, the gem will upload gzipped javascripts and stylesheets and serve them when the user-agent supports it.
4
20
 
5
21
  ## Installing
6
22
 
7
- Include the gem in your app's `environment.rb` or Gemfile. It is hosted at Gemcutter[http://gemcutter.org/gems/cloudfront_asset_host]
23
+ gem install cloudfront_asset_host
24
+
25
+ Include the gem in your app's `environment.rb` or `Gemfile`.
8
26
 
9
27
  ### Dependencies
10
28
 
29
+ The gem relies on `openssl md5` and `gzip` utilities. Make sure they are available locally and on your servers.
30
+
31
+ ### Configuration
32
+
11
33
  Make sure your s3-credentials are stored in _config/s3.yml_ like this:
12
34
 
13
35
  access_key_id: 'access_key'
14
36
  secret_access_key: 'secret'
15
37
 
16
- The gem relies on +openssl md5+ and +gzip+ utilities. Make sure they are available locally and on your servers.
17
-
18
- ### Configuration
19
38
  Create an initializer to configure the plugin _config/initializers/cloudfront_asset_host.rb_
20
39
 
21
40
  # Simple configuration
@@ -32,11 +51,11 @@ Create an initializer to configure the plugin _config/initializers/cloudfront_as
32
51
  config.s3_config = "#{RAILS_ROOT}/config/s3.yml" # Alternative location of your s3-config file
33
52
 
34
53
  # gzip related configuration
35
- config.gzip = true # enable gzipped assets (defaults to true)
54
+ config.gzip = true # enable gzipped assets (defaults to true)
36
55
  config.gzip_extensions = ['js', 'css'] # only gzip javascript or css (defaults to %w(js css))
37
56
  config.gzip_prefix = "gz" # prefix for gzipped bucket (defaults to "gz")
38
57
 
39
- config.enabled = true if Rails.env.production? # only enable in production
58
+ config.enabled = true if Rails.env.production? # only enable in production
40
59
  end
41
60
 
42
61
  ## Usage
@@ -50,6 +69,14 @@ If the plugin is enabled. Rails' internal `asset_host` and `asset_id` functional
50
69
  ### Other plugins
51
70
  When using in combination with SASS and/or asset_packager it is recommended to generate the css-files and package your assets before uploading them to Cloudfront. For example, call `Sass::Plugin.update_stylesheets` and `Synthesis::AssetPackage.build_all` first.
52
71
 
72
+ ## Contributing
73
+
74
+ Feel free to fork the project and send pull-requests.
75
+
76
+ ## Known Limitations
77
+
78
+ - Does not delete old assets
79
+
53
80
  ## Compatibility
54
81
 
55
82
  Tested on Rails 2.3.5 with SASS and AssetPackager plugins
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cloudfront_asset_host}
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Menno van der Sman"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 0
9
- version: 1.0.0
8
+ - 1
9
+ version: 1.0.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Menno van der Sman