Girolabs / fathersApp

Schoenstatt Fathers social app
4 stars 2 forks source link

Fathers photo cache duration #279

Open jroedel opened 1 year ago

jroedel commented 1 year ago

Las fotos de las personas se deben cachear por un máximo de 7 días sin revalidar su actualidad.

P. Francisco me ha mostrado una impresión de pantalla de una foto antigua de una persona que se había actualizado 12 días antes. Hoy es el 30 de diciembre y la foto en la página web se cambió el día 17 de diciembre.

El servidor dice que una foto se puede guardar en caché por 3 días máximo. Alisto los headers de esta foto de la persona en cuestión:

HTTP/2 200 OK
last-modified: Sat, 17 Dec 2022 15:44:11 GMT
accept-ranges: bytes
content-length: 229166
strict-transport-security: max-age=63072000; includeSubDomains; preload
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
referrer-policy: no-referrer, strict-origin-when-cross-origin
cache-control: max-age=259200, public, only-if-cached
content-type: image/jpeg
date: Fri, 30 Dec 2022 07:09:06 GMT
server: Apache
X-Firefox-Spdy: h2
angoybu commented 1 year ago

@jroedel podrías aclarar un punto? En la versión actual de la app, las fotos se estan cacheando? Podrias agregar screenshots en caso de tener?

jroedel commented 1 year ago

Parece que sí. Hice una prueba.

  1. Busqué mi nombre en la app, abrí mi pantalla personal
  2. Cerré la app, esperé un minuto
  3. Busqué nuevamente mi nombre, abrí mi perfil
  4. Analicé los logs del servidor:
    schoenstatt-fathers.link 0 xx.xx.252.40 - - [30/Dec/2022:16:03:46 +0100] "GET /pt/api/v1/persons/667 HTTP/2.0" 200 7930 "-" "Schoenstatt%20Fathers/6 CFNetwork/1399 Darwin/22.1.0"
    schoenstatt-fathers.link 0 xx.xx.252.40 - - [30/Dec/2022:16:03:46 +0100] "GET /pt/api/v1/persons/667 HTTP/2.0" 200 7930 "-" "Schoenstatt%20Fathers/6 CFNetwork/1399 Darwin/22.1.0"
    schoenstatt-fathers.link 0 xx.xx.252.40 - - [30/Dec/2022:16:03:46 +0100] "GET /fathers/photos/667.jpg HTTP/2.0" 200 70142 "-" "Schoenstatt%20Fathers/6 CFNetwork/1399 Darwin/22.1.0"
    schoenstatt-fathers.link 0 xx.xx.252.40 - - [30/Dec/2022:16:03:46 +0100] "GET /pt/api/v1/interface-data HTTP/2.0" 200 52348 "-" "Schoenstatt%20Fathers/6 CFNetwork/1399 Darwin/22.1.0"
    schoenstatt-fathers.link 0 xx.xx.252.40 - - [30/Dec/2022:16:03:46 +0100] "GET /pt/api/v1/interface-data HTTP/2.0" 200 52348 "-" "Schoenstatt%20Fathers/6 CFNetwork/1399 Darwin/22.1.0"
    schoenstatt-fathers.link 0 xx.xx.252.40 - - [30/Dec/2022:16:04:24 +0100] "GET /pt/api/v1/persons/667 HTTP/2.0" 200 7930 "-" "Schoenstatt%20Fathers/6 CFNetwork/1399 Darwin/22.1.0"
    schoenstatt-fathers.link 0 xx.xx.252.40 - - [30/Dec/2022:16:04:25 +0100] "GET /pt/api/v1/persons/667 HTTP/2.0" 200 7930 "-" "Schoenstatt%20Fathers/6 CFNetwork/1399 Darwin/22.1.0"
    schoenstatt-fathers.link 0 xx.xx.252.40 - - [30/Dec/2022:16:04:26 +0100] "GET /pt/api/v1/interface-data HTTP/2.0" 200 52348 "-" "Schoenstatt%20Fathers/6 CFNetwork/1399 Darwin/22.1.0"
    schoenstatt-fathers.link 0 xx.xx.252.40 - - [30/Dec/2022:16:04:26 +0100] "GET /pt/api/v1/interface-data HTTP/2.0" 200 52348 "-" "Schoenstatt%20Fathers/6 CFNetwork/1399 Darwin/22.1.0"

La segunda vez los logs no muestra la foto cargándose