refile_cache 0.1.0 → 0.1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57983cb55d17da798519ad854943fa6a458b9478
4
- data.tar.gz: d63d01e0e75ad5cb412ad6a3d8156b62908091ee
3
+ metadata.gz: d485333be3c97c972b097522d813c698c8a08b73
4
+ data.tar.gz: 47c35db692febe8b5e4408d36e967239c8a308bd
5
5
  SHA512:
6
- metadata.gz: e7b2cf4996ec2c4132d5f081e22e2a472206fb300929d14501c719a2cb561db2f34d75b536fd855a32c96e9cfa82700620d515bfc65480cec0e6fb179d82481f
7
- data.tar.gz: 0cef1fc4c28d776191c7f026ccda4c2bd6cfcdf6ecad021ab09391560578b225ee9f1d585447021317711b15fb310a84fcd604a5cfe58e17254134aa483447b5
6
+ metadata.gz: 47c39d9da1526244878c3060af34d9b4a43edaa8b287cb6a48d86a7d81bb9ec2cd31dc7bb8bc9df07b45d40ce2ab035b7c3a6ddfe8faaa95ef96d0d7a5e704bb
7
+ data.tar.gz: 6b71bdb39e6f0d70540059748453cc930c99680422d38aad553acffbe14ca7367ffcab445a633af2b19786482fe6775e26ea82c4931522617264641ccef7b163
@@ -12,7 +12,7 @@ module RefileCache
12
12
  # This is for autoreloading to be working :D
13
13
  class Logic
14
14
  URL_PATH = /\A#{Refile.mount_point}\/.*\/store\/(fill|fit|limit|pad|convert)\//
15
- URL_PROCESSOR = /\A#{Refile.mount_point}\/(?<token>.*)\/(?<backend>.*)\/(?<processor>(fill|fit|limit|pad|convert))\/(?<splat>.*)\/(?<id>.*)\/(?<file_base>.*)\.(?<extension>.*)/
15
+ URL_PROCESSOR = /\A#{Refile.mount_point}\/(?<token>.*)\/(?<backend>.*)\/(?<processor>(fill|fit|limit|pad|convert))\/(?<splat>.*)\/(?<id>.*)\/(?<file>.*)/
16
16
 
17
17
  def initialize(app)
18
18
  @app = app
@@ -28,9 +28,7 @@ module RefileCache
28
28
  cache_key = "cache#{params[:id]}#{params[:processor]}#{params[:splat].delete('/')}"
29
29
 
30
30
  if backend.exists?(cache_key)
31
- file = backend.get(cache_key)
32
- filename = "#{params[:file_base]}.#{params[:extension]}"
33
- return [200, own_headers(filename, file.size), stream_file(env, file)]
31
+ return [301, { 'Location' => "https://#{ENV['S3_BUCKET_NAME']}.s3.amazonaws.com/image_cache/#{cache_key}" }, []]
34
32
  end
35
33
 
36
34
  status, headers, response = @app.call(env)
@@ -69,9 +67,9 @@ module RefileCache
69
67
  'Access-Control-Allow-Headers' => '',
70
68
  'Access-Control-Allow-Method' => '',
71
69
  'Cache-Control' => 'public, max-age=31536000',
72
- 'Expires' => (Time.now + 1.year).to_s,
70
+ 'Expires' => (Time.now + 1.year).gmtime.to_s,
73
71
  'Content-Disposition' => "inline; filename=\"#{filename}\"",
74
- 'Last-Modified' => (Time.now - 1.month).to_s,
72
+ 'Last-Modified' => (Time.now - 1.month).gmtime.to_s,
75
73
  'Content-Length' => content_length.to_s,
76
74
  'X-Content-Type-Options' => 'nosniff'
77
75
  }
@@ -1,3 +1,3 @@
1
1
  module RefileCache
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refile_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blueberry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2017-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: refile
@@ -105,9 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.4.5
108
+ rubygems_version: 2.5.1
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: RefileCache
112
112
  test_files: []
113
- has_rdoc: