you could run the artisan command in the background? or even do it using ajax..
humm interesting! But how to graft it with the remember function? For if we are in the function is that the cache has expired (and therefore not displayable)
Sorry i'm french ;-)
I retry without Google translate :)
My amazon's function work only when cache it expired, so if I launch artisan command at this time (in my remember's function), same problem -> waiting long response from amazon.
So my question is : How I can use artisan command with remember cache function and push always cache version ?
Thanks for your help
Request informations product from Amazon API with SOAP/REST and I get XML data's product. And I must refresh each hour the datas.. (avg 3/4 sec for obtains datas before cache, it is too long for visitors !)
if you must refresh each hour then I would use a cron job to do this.. would that work?
Yes it's an idea :) But how do you know the files that I need to refresh ? (actually each type pages has a static name). (ie. cache_amazon_product_item_' . $ASIN) Thx
Use queues http://laravel.com/docs/5.1/queues
The idea is to store the event you wish to do later inside a database (redis or mysql etc) And when the server is not busy, it will do the events that are waiting.
The default option is set to sync, it will try to do the task before returning the view to the user, you should simply change that setting and the task will be performed asynchronously just as you want it.
Forget commands or crons.
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us