|
I have nginx config similar to https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-3.1#configure-nginx and processor: namespace AppThumbnailer
{
public class ThumbnailWebProcessor : IImageWebProcessor
{
private static readonly ResizeOptions _resizeOptions = new ResizeOptions
{
Size = new Size(300),
Mode = ResizeMode.Max
};
private static readonly IEnumerable<string> _commands = new[]
{
"size"
};
public FormattedImage Process(
FormattedImage image,
ILogger logger,
IDictionary<string, string> commands,
CommandParser parser,
CultureInfo culture)
{
var command = commands.GetValueOrDefault("size");
if (command == "medium")
{
image.Image.Mutate(x => x.Resize(_resizeOptions));
image.Format = JpegFormat.Instance;
}
return image;
}
public IEnumerable<string> Commands => _commands;
}
}It's works fine, but produces random empty responses(without any app error). Nginx response: App log: Upd: Also, my app use signalr and shows images for many clients at same time. So maybe it's cache key lock problem? |
Answered by
hey-red
May 14, 2021
Replies: 2 comments 1 reply
|
I'm afraid I've never used nginx so cannot be of any help. The library doesn't have any cache locking and would throw IO exceptions if there were issues retrieving files from the cache. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems like it fixed #160