docs icon indicating copy to clipboard operation
docs copied to clipboard

don't generate a 404 from Shopware for missing images

Open jonashrem opened this issue 1 year ago • 7 comments

PHP Version

/

Shopware Version

6.6

Affected area / extension

Platform(Default)

Expected behaviour

On a missing media file in media or themes folder, shopware should not be instancieted at all

Actual behaviour

At the moment, for every request resulting in a 404 from the web server, the Shopware index.php is called by .htaccess or nginx configuration.

This can create a negative performance impact, when clients try to access non-existing files like missing images or ico files.

For performance reasons, I suggest adding an option, to remove the media fallback completely ( in the installer for example )

How to reproduce

call a non existent media file ( you'll see a 404 Shopware page )

jonashrem avatar Aug 26 '24 17:08 jonashrem

[public] Shopware automated response: This issue is linked to the internal issue https://shopware.atlassian.net/browse/NEXT-38057.

This link is only intended for Shopware employees and for internal use only.

[created from NEXT-38057, comment 490378]

shopwareBot avatar Aug 26 '24 17:08 shopwareBot

In the Caddy config, we have

@default {
    not path /theme/* /media/* /thumbnail/* /bundles/* /css/* /fonts/* /js/* /recovery/* /sitemap/*
  }

I think we could adopt this to Nginx (idk what you are using)

shyim avatar Aug 27 '24 07:08 shyim

we have customers with apache or nginx,

do you want me to write a PR?

jonashrem avatar Aug 27 '24 14:08 jonashrem

would be nice if you could adjust the documentation, I think you know more what you do there :)

shyim avatar Aug 28 '24 07:08 shyim

NGINX: https://github.com/shopware/docs/pull/1480

jonashrem avatar Sep 15 '24 10:09 jonashrem

Apache: #4730

jonashrem avatar Sep 15 '24 10:09 jonashrem

@jonashrem, Since the topic has been brought to the product team's attention, I will close this issue. The PR in docs was merged, and I reached out to the maintainer of the flex repo for the current status.

Thx for your patience and PRs! :raised_hands:

Isengo1989 avatar Oct 01 '24 07:10 Isengo1989