about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-04 12:58:35 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-04 12:58:35 +0100
commit24e692b0cf1e6b2c3f1f209bebb39f0f9a97eb20 (patch)
treedb50329a328b4841b1f71d908079c99eccb6d48e /app/helpers
parent80c44ed9c19855d494ab26011dca0f6fbc644d0c (diff)
Set a specific S3 expiration time so that files can be cached
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb4
-rw-r--r--app/helpers/stream_entries_helper.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 29c2c9120..762a972ec 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -5,7 +5,7 @@ module ApplicationHelper
     current_page?(path) ? 'active' : ''
   end
 
-  def id_paginate(path, per_page, collection)
-  	# todo
+  def s3_expiry
+    Time.zone.now.beginning_of_day.since 25.hours
   end
 end
diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb
index 4abb00b07..6a8e67040 100644
--- a/app/helpers/stream_entries_helper.rb
+++ b/app/helpers/stream_entries_helper.rb
@@ -6,7 +6,7 @@ module StreamEntriesHelper
   end
 
   def avatar_for_status_url(status)
-    status.reblog? ? status.reblog.account.avatar.expiring_url(3600, :original) : status.account.avatar.expiring_url(3600, :original)
+    status.reblog? ? status.reblog.account.avatar.expiring_url(s3_expiry, :original) : status.account.avatar.expiring_url(s3_expiry, :original)
   end
 
   def entry_classes(status, is_predecessor, is_successor, include_threads)