Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use cache appropriately? #1105

Open
darkamenosa opened this issue May 9, 2023 · 1 comment
Open

How to use cache appropriately? #1105

darkamenosa opened this issue May 9, 2023 · 1 comment

Comments

@darkamenosa
Copy link

Hi @mbleigh,

First of all, I want to thank you for the wonderful library.

Forgive me to ask a dumb question. How to use cache appropriately?

I followed this https://github.com/mbleigh/acts-as-taggable-on/wiki/Caching to create cached tags. I also finished the migration. However, I don't know what is the correct way to use the cached tag.

I can use the cached_<somename>_list field directly. But I don't feel like it is the right way to do it.
I'm assuming that just use the library the normal way, and it will automatically query cached_<somename>_list first, before doing anything else.

Is my assumption wrong?

Thank you for your time, and have a nice day ahead!

Tom

@chakraskun
Copy link

it's the right way to do it.
if you call the @model.cached_<column_name>_list, it'll get the record from the column.
no extra query to ActAsTaggableOn table.

you are doing the right thing 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants