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

Webp Image not generating when azure CDN enabled (Sitecore 9.2 + JSS) #111

Closed
PradeepSitecore opened this issue Apr 25, 2022 · 4 comments
Closed

Comments

@PradeepSitecore
Copy link

Sitecore 9.2 (JSS) and Dianoga 5.3.0

With Dianoga.WebP.config enabled, I replaced JSS media handler in web.config:

with custom one:

using MediaRequestHandler = Sitecore.JavaScriptServices.Media.MediaRequestHandler;

public class JSSWebPMediaHandler : MediaRequestHandler
{
    protected override bool DoProcessRequest(HttpContext context, MediaRequest request, Media media)
    {
        if (context?.Request.AcceptTypes != null && context.Request.AcceptTypes.Contains("image/webp"))
        {
            request.Options.CustomOptions["extension"] = "webp";
        }
        return base.DoProcessRequest(context, request, media);
    }
},

Environment description

Scaled environment

What configs you have enabled

Dianoga.DisableForSites.config,
Dianoga.Jpeg.config,
Dianoga.Png.config,
Dianoga.WebP.CDN.config ,
Dianoga.WebP.config,
Dianoga.Svg.configDianoga.Svg.config,

What you expected to see, versus what you actually saw

expected result : Images should convert to webp format
Actual result : Images are coming in same png and jpg format

In standalone environment without CDN the images are converting to webp images but in scaled environment with Azure CDN images are not converting

Relevant logs

There are relevant logs

@markgibbons25
Copy link
Collaborator

In Azure CDN can you make sure that cache by query string is enabled?

@PradeepSitecore
Copy link
Author

PradeepSitecore commented Apr 26, 2022

@markgibbons25 , Yes Its enabled.
image

@markgibbons25
Copy link
Collaborator

markgibbons25 commented Apr 26, 2022

I'm not sure then, I haven't tested it with JSS / Azure CDN / Azure Front Door, only with CloudFlare (no JSS). I'd say its more likely an issue with JSS not having the right query string.

@markgibbons25 markgibbons25 changed the title Webp Image not generating when azure CDN enabled (sitecore 9.2) Webp Image not generating when azure CDN enabled (Sitecore 9.2 + JSS) Apr 26, 2022
@markgibbons25
Copy link
Collaborator

For Azure CDN support you'll need to upgrade to 6.1.0 and review the readme config for this.

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

No branches or pull requests

2 participants