I’m developing a script that will allow people to generate a banner for them to use. It’s customizable. During the customization process, I’d like to be able to have the banner reload on the spot. So they could see the changes. Once they create the banner and are completely done with it I would give them a link for them to use. This link be a cached version of the banner and would recache every so often. Is there any way I can prevent them from abusing my on-the-spot generation to prevent excessive server load? Is there a way that I can make it so only my JavaScript can regenerate it?
Share
You probably need to defend against images that are loaded too often, regardless of whether this comes from abuse or from having too many actual visitors. You can allocate a maximum number of refreshes for a given time period (depending on how loaded you want your server to be) for each image, and determine for each request whether you should generate a file or return a static error image.