Magento2: Media server issue

Created on 17 Jun 2017  路  4Comments  路  Source: magento/magento2

This may be as intended but here we go. We are designing a new setup for a customer and found a small issue in 2.1.7. There is 6 servers in the setup

Admin / media
www01
www02
db
cache
proxy

We have all the media loading off admin / media server via a sub domain media.domain.com the admin panel is loaded off admin.domain.com. We have sync scripts that sync everything from admin to www01 and www02. This works great but when i remove the pub/image/cache folder I lose all product images on the site. Now if i view source when they work its loaded off the media server when i remove the files from www01 and www02 i get the place holder.

What i am curious about is does magento look to local domain.com then redirect the code to load from media.domain.com? Or is this a bug?

I would like to keep media off my www servers to conserve space and its less over head to for lsync to scan after about 500k products.


Preconditions


  1. 2.1.7
  2. php 7.0
  3. mysql 5.6

Steps to reproduce

  1. Setup a media server point all static and js files to media server
  2. remove pub cache on www servers
  3. 3.

Expected result

  1. Images should ALL be loaded from the meida server it seems if its not on the cache in local www servers it load the default thumbnail

Actual result

  1. images seem to be loaded from cache on www server first then redirected to media if its found there.

Format is valid needs update bug report

All 4 comments

What i am curious about is does magento look to local domain.com then redirect the code to load from media.domain.com? Or is this a bug?

Sounds like a bug to me. I would guess that's it's doing the file_exists check on the wrong location ignoring your media domain setting (only using it later when returning URL to frontend).
I guess you could check that hypothesis by replacing images on your www instances with zero-size files having same names. That would be a funny workaround :)

LOL, funny you mention that. I talked to my team about doing that and its ugly but it works..

Hi @zdjm Is the issue still actual?

@zdjm, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

Was this page helpful?
0 / 5 - 0 ratings