You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I wrote a custom path generator when I started my project, then further into the project, realized I was generating N1+1 queries every time I used ->getUrl(). This was due to the fact I was doing a query on the media item each time to find the parent model, and then constructing the path using various attributes of said model.
My solution to this problem was to cache the generated path in the custom property of each media item the first time ->getUrl is called.
My question is, is there a way to observe the “move” or ”moved” event so I can erase the old stored path?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. I wrote a custom path generator when I started my project, then further into the project, realized I was generating N1+1 queries every time I used ->getUrl(). This was due to the fact I was doing a query on the media item each time to find the parent model, and then constructing the path using various attributes of said model.
My solution to this problem was to cache the generated path in the custom property of each media item the first time ->getUrl is called.
My question is, is there a way to observe the “move” or ”moved” event so I can erase the old stored path?
Beta Was this translation helpful? Give feedback.
All reactions