webcoast-dk / deferred-image-processing

TYPO3 extension for handling image processing on request instead of during page generation
GNU General Public License v3.0
12 stars 9 forks source link

Rule for nginx and support for webp files #27

Open hacksch opened 4 months ago

hacksch commented 4 months ago

Hello,

please extend the documentation for nginx with

if (!-f $request_filename) { rewrite ^/(fileadmin/_processed_/.+)\.(gif|jpg|jpeg|png|webp)$ /index.php; } and please add support for webp files in the apache rule as well.

PS: great work

xerc commented 2 months ago

@hacksch can you please provide a (full & indented) NGINX conf.?

regarding APACHE you can write like this ..

  RewriteCond %{HTTP_ACCEPT} ^image/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule /_processed_/ %{ENV:CWD}index.php [L]

or try my v12 beta preview @ https://github.com/xerc/deferred-image-processing/tree/feature/support-typo3-cms-12 :)

hacksch commented 2 months ago

This is my working nginx configuration

v11 if (!-f $request_filename) { rewrite ^/(fileadmin/_processed_/.+)\.(gif|jpg|jpeg|png|webp)$ /index.php; }

v12 if (!-f $request_filename){ rewrite "/fileadmin/_processed_/.+_([0-9a-f]{10})\.(gif|jpe?g|png|webp)$" /index.php?dip[chk]=$1&dip[ext]=$2; }

Can you give me a hint why you have used "^image" in your rule instead fileadmin?

xerc commented 2 months ago

thanks

Can you give me a hint why you have used "^image" in your rule instead fileadmin?

so only request for images are processes - might not be needed cause in _processed_ are only images