webp-on-demand | Serve autogenerated WebP images instead of jpeg/png | Image Editing library
kandi X-RAY | webp-on-demand Summary
kandi X-RAY | webp-on-demand Summary
A setup consists of these parts:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Serve an image .
- Generate jobs .
- Serve original image
- Add WebP header .
- Add Vary header if set .
- Add a path to the queue .
webp-on-demand Key Features
webp-on-demand Examples and Code Snippets
true // Show a conversion report instead of serving the converted image.
// More options available!
];
WebPOnDemand::serve($source, $destination, $options);
RewriteEngine On
# Redirect images to webp-on-demand.php (if browser supports webp)
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteRule ^(.*)\.(jpe?g|png)$ webp-on-demand.php?source=%{SCRIPT_FILENAME} [NC,L]
AddType image/webp .webp
Community Discussions
Trending Discussions on webp-on-demand
QUESTION
I'm using laravel and in that public directory I'm using this .htaccess to redirect every jpg, jpeg or png file to php file whch can generate webp file. Problem is everything is working on localhost and but in shared hosting .htaccess not working.
public/.htaccess
...ANSWER
Answered 2020-Mar-29 at 16:16Turns out if was image cache problem by dns service provider aka cloudfare. All I did was Go to domain -> Caching tab and Purge everything. Now every new request for images are redirected to my php file which convert to webp and store in same directory and send png and jpeg images as image/webp type without changing image url or path or adding .webp extension
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install webp-on-demand
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page