Support the ongoing development of Laravel.io →
posted 6 years ago
Cache
Last updated 6 months ago.
0

you could run the artisan command in the background? or even do it using ajax..

0

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)

0

dont understand you?

0

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

0

what is this amazon function and what does it do?

0

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 !)

0

if you must refresh each hour then I would use a cron job to do this.. would that work?

0

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

0

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.

0

Thx ! I look at it quickly :)

0

Sign in to participate in this thread!

LoadForge

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.