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

Allow for caching of widgets #421

Merged
merged 7 commits into from May 10, 2019
Merged

Allow for caching of widgets #421

merged 7 commits into from May 10, 2019

Conversation

@bobdenotter
Copy link
Member

@bobdenotter bobdenotter commented May 9, 2019

Makes a big difference, especially for widgets like 'news'...

Before:

Screenshot 2019-05-09 at 22 02 39

After:

Screenshot 2019-05-09 at 22 02 54

$this->key = $this->createKey();
}

public function cachedInvoke(): string
Copy link
Member

@JarJak JarJak May 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't this method just overwrite __invoke() ?

Loading

Copy link
Member Author

@bobdenotter bobdenotter May 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to try something else to make it more elegant.

Overriding it would be nice, but won't work in this case. A trait can override methods from the base (extended) class, but then there's no such thing as a ::parent.

Loading

src/Widget/CacheAware.php Outdated Show resolved Hide resolved
Loading
src/Widget/SnippetWidget.php Outdated Show resolved Hide resolved
Loading
JarJak
JarJak approved these changes May 10, 2019
@bobdenotter bobdenotter added this to the Bolt 4 beta 1 milestone May 10, 2019
@bobdenotter bobdenotter merged commit c844cc0 into master May 10, 2019
1 check passed
Loading
@bobdenotter bobdenotter deleted the fix/cache-widgets branch May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants