wp-media / wp-media/imagify-plugin

Wordpress / nginx - png instead of webp

Open
#498 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting for feedback
Dominant language
PHP
Stars
82
Forks
31
Avg merge
5d 10h
Merged PRs (30d)
9

Description

Hej
i have used nginx rule:

location ~* ^(/.+)\.(jpg|jpeg|jpe|png|gif)$ {
	add_header Vary Accept;

	if ($http_accept ~* "webp"){
		set $imwebp A;
	}
	if (-f $request_filename.webp) {
		set $imwebp  "${imwebp}B";
	}
	if ($imwebp = AB) {
		rewrite ^(.*) $1.webp;
	}
}

because <picture> tag has not displayed images for some users...
i have changed to rewrite rule.. but now there are displayed just png files instead of webp..

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied nginx location block and rewrite rule, checking the request's Accept header and whether the matching .webp file exists. Reproduce a WordPress image request from a browser that supports WebP and compare the response with the original PNG request. Done means supported clients receive the WebP asset while others still receive the original image.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx, wordpress
Domain
performance, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.