Skip to content

Limit and lazy load older read notifications #47

Description

@akulmehta

Currently, the package loads all older notifications into the view. If only a few notifications are there, it doesn't matter. However, if the user / your app doesn't clear the old, read notifications, it causes some performance loss as it loads a lot of the views. As an example, in my dev environment for one of my projects, megaphone is loading over 182 views of multiple types, as shown in the debugbar:

Image

It also, loads more models, which can increase the memory consumption of the app.

For example, in my project the megaphone package was loading 416 models.

Image

Proposed Solution

What if we could limit the loading of older, read notifications and create a "Show older" button to load more older read notifications lazily as needed. We could use the Laravel and Livewire's pagination powers to load more notifications (see https://forum.laravel-livewire.com/t/implement-load-more-pagination/871/4 as an example).

This would improve the performance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions