m-a-k-o / nova-custom-table-card

Simple Nova Card for Custom Tables
MIT License
46 stars 26 forks source link

card called on every page, slowing the entire nova #31

Closed meyer59 closed 2 years ago

meyer59 commented 2 years ago

Hello We had recently running into an issue that our entire nova was very slow. We used Blackfire to profile our app. We were able to find out that the Cutom table Card ware called on every url. Is that normal ? Since we have large Table this was the root cause. Is this the attended behavior to have those card be called on every url ? even if we are displaying them only on the dashboard ? Thank you for your help here

ibrunotome commented 2 years ago

"Fixed" this by only running the content of cards() if the request was made by the correct dashboard:

        if (!request()->is('nova-api/dashboards/sales-dashboard*')) {
            return [];
        }
m-a-k-o commented 2 years ago

I think that was related to Nova internals.

In Nova v.4 it seems to be fixed.