Image resizer “creating breakpoints”

北战南征 提交于 2019-12-12 03:34:00

问题


I'm using ASP.NET ImageResizer library, I have my application working well.

But I came across two problems, first is single ip requesting many images like:

image.jpeg?width=10 
image.jpeg?width=11 
image.jpeg?width=12 
image.jpeg?width=13 

But this I simply resolve alowing X request per minute.

My second problem is that I dont want to create ALL images, I want breakpoints, somethig like:

  • 1º - 320w- 213h

  • 2º - 453w- 302h

  • 3º - 579w- 386h

  • 4º - 687w- 458h

  • 5º - 786w- 524h

... This table I get from this great article.

My question is can I do it with ImageResizer library configurations, or do I have to work around to overtake this problem?


回答1:


ImageResizer offers "Presets", and you can lock it down so only presets can be used. These are typically used to create breakpoints as you describe.

If you have attackers, there are many IPS systems that can detect malicious attacks based on pattern and block them. CloudFlare is also good at this.



来源:https://stackoverflow.com/questions/35455616/image-resizer-creating-breakpoints

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!