Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add htaccess redirect rules for WebP images #6194

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

martinkrcho
Copy link

@martinkrcho martinkrcho commented Sep 28, 2023

Description

If the WebP Compatibility is enabled, the website serves only WebP images that are directly linked from the HTML source of the page. It doesn’t serve WebP equivalents of images:

  • linked from CSS files
  • linked from JS files
  • linked from encoded JS data inside HTML source
  • with URLs dynamically loaded via API call or other means

This pull request adds extra redirect rules that will be placed in the .htaccess file. These rules will results in loading WebP equivalents of JPG, PNG and BMP images if they exists on the filesystem.

Request for feedback

  • Is there a reason why this wasn’t already part of the plugin?
  • Were there some concerns regarding this solution?

Type of change

  • Enhancement (non-breaking change which improves an existing functionality).

Checklists

Generic development checklist

  • My code follows the style guidelines of this project, with adapted comments and without new warnings.
  • The CI passes locally with my changes (including unit tests, integration tests, linter).

Test summary

  • I have performed a self-review of my own code
  • Existing unit tests pass locally with my changes
  • I triggered all changed lines of code at least once without new errors/warnings/notices.

@martinkrcho martinkrcho marked this pull request as ready for review October 3, 2023 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant