shopware / docs

Shopware 6 developer docs
https://developer.shopware.com/
51 stars 259 forks source link

don't generate a 404 from Shopware for missing images #1461

Closed jonashrem closed 1 month ago

jonashrem commented 2 months ago

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 )

shopware-issue-bot[bot] commented 2 months ago

We found the following existing issues which may help or are related to your topic:

shopwareBot commented 2 months ago

[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]

shyim commented 2 months ago

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)

jonashrem commented 2 months ago

we have customers with apache or nginx,

do you want me to write a PR?

shyim commented 2 months ago

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

jonashrem commented 2 months ago

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

jonashrem commented 2 months ago

Apache: #4730

Isengo1989 commented 1 month ago

@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: