mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 04:11:41 +00:00
agregar caché a la imagen por la duración de la cookie #75
This commit is contained in:
parent
e21ccfd29e
commit
6b985d778b
1 changed files with 4 additions and 3 deletions
|
@ -56,12 +56,13 @@ module Api
|
||||||
#
|
#
|
||||||
# Enviamos un token de protección CSRF
|
# Enviamos un token de protección CSRF
|
||||||
def set_cookie
|
def set_cookie
|
||||||
|
# TODO: Volver configurable por sitio
|
||||||
|
expires = ENV.fetch('COOKIE_DURATION', '30').to_i.minutes
|
||||||
|
|
||||||
headers['Access-Control-Allow-Origin'] = return_origin
|
headers['Access-Control-Allow-Origin'] = return_origin
|
||||||
headers['Access-Control-Allow-Credentials'] = true
|
headers['Access-Control-Allow-Credentials'] = true
|
||||||
headers['Vary'] = 'Origin'
|
headers['Vary'] = 'Origin'
|
||||||
|
headers['Cache-Control'] = "private, max-age=#{expires}, stale-while-revalidate=#{expires}"
|
||||||
# TODO: Volver configurable por sitio
|
|
||||||
expires = ENV.fetch('COOKIE_DURATION', '30').to_i.minutes
|
|
||||||
|
|
||||||
cookies.encrypted[site_id] = {
|
cookies.encrypted[site_id] = {
|
||||||
httponly: true,
|
httponly: true,
|
||||||
|
|
Loading…
Reference in a new issue