From 24e692b0cf1e6b2c3f1f209bebb39f0f9a97eb20 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 4 Dec 2016 12:58:35 +0100 Subject: Set a specific S3 expiration time so that files can be cached --- app/views/stream_entries/_status.html.haml | 2 +- app/views/stream_entries/show.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views/stream_entries') diff --git a/app/views/stream_entries/_status.html.haml b/app/views/stream_entries/_status.html.haml index 42994abbd..8d6507623 100644 --- a/app/views/stream_entries/_status.html.haml +++ b/app/views/stream_entries/_status.html.haml @@ -34,7 +34,7 @@ - if (status.reblog? ? status.reblog : status).media_attachments.size > 0 %ul.media-attachments - (status.reblog? ? status.reblog : status).media_attachments.each do |media| - %li.transparent-background= link_to '', media.file.expiring_url(3600, :original), style: "background-image: url(#{media.file.expiring_url(3600, :small)})", target: '_blank' + %li.transparent-background= link_to '', media.file.expiring_url(s3_expiry, :original), style: "background-image: url(#{media.file.expiring_url(s3_expiry, :small)})", target: '_blank' - if include_threads = render partial: 'status', collection: @descendants, as: :status, locals: { is_successor: true } diff --git a/app/views/stream_entries/show.html.haml b/app/views/stream_entries/show.html.haml index 76dfa6dac..9a134ab16 100644 --- a/app/views/stream_entries/show.html.haml +++ b/app/views/stream_entries/show.html.haml @@ -7,7 +7,7 @@ %meta{ name: 'og:title', content: "#{@account.username} on #{Rails.configuration.x.local_domain}" }/ %meta{ name: 'og:article:author', content: @account.username }/ %meta{ name: 'og:description', content: @stream_entry.activity.content }/ - %meta{ name: 'og:image', content: @stream_entry.activity.is_a?(Status) && @stream_entry.activity.media_attachments.size > 0 ? full_asset_url(@stream_entry.activity.media_attachments.first.file.expiring_url(3600, :small)) : full_asset_url(@account.avatar.expiring_url(3600, :original)) }/ + %meta{ name: 'og:image', content: @stream_entry.activity.is_a?(Status) && @stream_entry.activity.media_attachments.size > 0 ? full_asset_url(@stream_entry.activity.media_attachments.first.file.expiring_url(s3_expiry, :small)) : full_asset_url(@account.avatar.expiring_url(s3_expiry, :original)) }/ .activity-stream.activity-stream-headless = render partial: @type, locals: { @type.to_sym => @stream_entry.activity, include_threads: true } -- cgit