H
H
HaruAtari2014-04-22 13:26:49
Nginx
HaruAtari, 2014-04-22 13:26:49

How to properly display images with a watermark?

Good afternoon.
There is a site where photos of works are published. I need these photos to be shown on the site without a watermark, and given to other sites with a caption. You can determine by hppt_referer. But the question is: at what point to apply the watermark?
1. Just before sending, you can generate an image with a caption and give it away. But this approach creates a lot of unnecessary load on the server.
2. When saving a photo, generate a copy with a watermark and then give it away. But in this case, the files will take up two slaves more space.
Please tell me the best way to solve this problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
DuD, 2014-04-23
@HaruAtari

Place is now cheaper than resources. Therefore, I think the best option would be to give the dynamically generated file for the first time and put it in the cache, and then give it from the cache.
If you feel sorry for the places, you can keep track of the "hotness" of images and delete the most unpopular ones from the cache

B
bredmm, 2014-04-22
@bredmm

why not generate an image with a watermark on request and put it in the cache
and return it from the cache when you re-access

1
1serfer, 2014-04-22
@1serfer

According to my subjective standards, the second option is suitable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question