-
Notifications
You must be signed in to change notification settings - Fork 45
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 issues #49
Comments
Will look on it |
How is the status with this one? |
Faced with the same issue on Sitecore v8 (not sure, it will work on other version, including v9, but hope so). Short SolutionAdd patch config file: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<mediaLibrary>
<requestProtection>
<protectedMediaQueryParameters>
<parameter description="Extension" name="extension" />
</protectedMediaQueryParameters>
</requestProtection>
</mediaLibrary>
</sitecore>
</configuration> Explanationclass public virtual string GetCacheKey()
{
Assert.IsTrue(MediaOptions.KnownOptions.Count == 9, "The cache key logic must be updated when known options are added or deleted.");
string str = string.Format("as={0}&bc={1}&h={2}&iar={3}&mh={4}&mw={5}&sc={6}&thn={7}&w={8}", (object) this.AllowStretch, (object) this.BackgroundColor.ToArgb(), (object) this.Height, (object) this.IgnoreAspectRatio, (object) this.MaxHeight, (object) this.MaxWidth, (object) this.Scale.ToString((IFormatProvider) CultureInfo.InvariantCulture.NumberFormat), (object) this.Thumbnail, (object) this.Width);
StringList stringList = new StringList();
foreach (string key in this.customOptions.Keys)
{
if (!MediaOptions.KnownOptions.ContainsKey(key) && (!MediaManager.Config.RequestProtection.Enabled || MediaManager.Config.RequestProtection.QueryParametersToProtect.Contains(key) || MediaManager.Config.RequestProtection.CustomQueryParameters.Contains(key)))
stringList.Add(key);
}
stringList.Sort((IComparer<string>) StringComparer.InvariantCulture);
foreach (string index in (List<string>) stringList)
str = str + "&" + index + "=" + this.customOptions[index];
return str;
} Which is used to define cache key for compressed image. Adding new |
how is it going forward with webp ? |
This is now resolved https://github.com/kamsar/Dianoga/releases/tag/5.0.0-beta.1 |
While testing #43 I ran across a number of issues in the WebP implementation. @Antonytm would you mind taking a look at these?
WebP images are re-optimized on every request
Reproduction:
/-/media/foo.jpg
) in a WebP-supporting browserExpected: the WebP should remain cached just once and be reused
WebP images converted from other formats are not actually served as WebP
/-/media/foo.jpg
) in a WebP-supporting browserimage/jpeg
)Expected: I should get the WebP cached version if the browser sends
image/webp
in the Accept header, and the original version if that is not present.It's worth noting that optimization works just fine with the cache as long as the WebP.config patch is disabled.
The text was updated successfully, but these errors were encountered: