You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pagespeed.apache.org by GitBox <gi...@apache.org> on 2020/04/29 11:19:29 UTC

[GitHub] [incubator-pagespeed-ngx] andrewbrg commented on issue #1686: Random 404s on re-written images (nginx with shared Redis cache)

andrewbrg commented on issue #1686:
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1686#issuecomment-621138315


   Hi, first of all thank you for your reply :)
   
   The redirects.inc are just for some old urls to 301 them to new pages, they don't do anything with pagespeed.
   
   HTTPS terminates at the pagespeed reverse proxy, upstream the application webserver communicates over HTTP which is why I have:  ` proxy_pass http://application_server;`
   
   Along with: `pagespeed MapOriginDomain http://127.0.0.1 https://$root_domain;`
   
   I'm not sure about the +debug, I've disabled image re-writing on production because of this and cannot just re-enable it to test. What i can tell you though is that for a few weeks all was fine, then new images were added to the site and they got rendered as 404s.
   
   At the same time I noticed that the redis DB was 99.9999% full (potentially un-realted, although there was 1GB of space in it to be used).
   
   We store images in a separate redis DB not on file and they are served via php. The separate redis db is in a cluster too.
   
   What would happen if:
   
   #1 webadmin uploads image to master redis
   #2 pagespeed from application instance requests it from redis slave which is not yet up to date
   #3 pagespeed hits a 404 on first attempt
   #4 data propagates the redis slaves
   #5 pagespeed tries again? Does it find it or persists with 404?
   
   BTW, the images are also behind an nginx cache, so on first request the application nginx get an image via PHP, but then pulls it from its cache (since rendering every time is very wasteful).
   
   However having said all this, only the newly added images broke old ones were fine, then i flushed the cached and a few older ones broke too so I removed the rewrite_images.
   
   It's strange.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org