A
A
Alexey Sannikov2017-08-25 23:11:48
PHP
Alexey Sannikov, 2017-08-25 23:11:48

Who can suggest the best option for generating a picture based on the background?

I describe the problem. There is a picture with a background (bg.jpg), using the imagemagick library, I form a second picture with my text (the second picture is image.jpg). The second picture is generated every hour (for example, not the essence) and is laid out on the site, in order to save space, I do not create all the pictures with the necessary text (there will be about 20k of them, it is unreasonable to store them all on a server, therefore everything is based on the background and the second picture already finished). It all works, everything is fine, the problem is different.

There is a button on the site that, when clicked, opens a modal window with the received image (image.jpg). But if I click on the image generation button again on the same page, then I get the previous image (which is understandable, because it was saved in the cache, the name is the same). If you reload the page, then when you click on the generate button, everything repeats, the first time everything is OK, and then the first picture constantly appears.

I see the following options:
1. By clicking on the button, do not do it in a modal window, but send it to a new tab, let's say, or reload
the page Logically it should work, but I don't know how to implement it.

What can you offer? Someone faced a similar problem?

ps no matter php or js, the main thing is to solve the problem (the site is powered by Laravel)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2017-08-25
@jexme

Substitute a random GET parameter to the image URL so that the browser does not cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question