arc icon indicating copy to clipboard operation
arc copied to clipboard

Expires header is N/A when uploading to S3.

Open jung-hunsoo opened this issue 6 years ago • 1 comments

Environment

  • Elixir version (elixir -v): 1.7.0 / 1.7.4
  • Arc version (mix deps): 0.11.0
  • Arc dependencies when applicable (mix deps): :arc_ecto, "0.11.1"
  • Operating system: Ubuntu 14.04 / Ubuntu 18.04

Expected behavior

Uploaded files are configured with cache control.

  def s3_object_headers(_, {file, _}) do
    [cache_control: "public",
     content_type: MIME.from_path(file.file_name),
     expires: 600]
  end

Actual behavior

Both cache-control and expires are N/A.

jung-hunsoo avatar Jan 21 '19 17:01 jung-hunsoo

try

  def s3_object_headers(_, {file, _}) do
    [
    # time in seconds
       cache_control: "public, max-age: 6100",
       content_type: MIME.from_path(file.file_name)
     ]
  end

iamsteeve avatar Aug 08 '22 21:08 iamsteeve