olivierbon / Placid

Placid is a Craft plugin which makes it easy to consume REST services in your twig templates
77 stars 5 forks source link

Cache duration #2

Closed bilke closed 9 years ago

bilke commented 10 years ago

How long is a request cached? It would be very nice to add cache duration as a parameter to the placid.get()-call.

By the way: I love this plugin! :cake:

alecritson commented 9 years ago

Hey Bilke,

Sorry it's taken me so long to reply to this, I had not received any notifications.

You can now specify a cache duration in your templates like this (time in seconds):

placid.get('handle', { duration : 3200} )

It might be worth mentioning that you should use the new tag placid.request(handle) instead as this will be more future proof with updates .get() will still work though!

If you don't specify a duration then it will use whatever is set in your config.

Thanks for using Placid, glad you're liking it :)

bilke commented 9 years ago

Thanks a lot for implementing caching!