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

Conversation

@bobdenotter
Copy link
Member

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

bobdenotter added some commits May 9, 2019

$this->key = $this->createKey();
}
public function cachedInvoke(): string

This comment has been minimized.

Copy link
@JarJak

JarJak May 10, 2019

Member

can't this method just overwrite __invoke() ?

This comment has been minimized.

Copy link
@bobdenotter

bobdenotter May 10, 2019

Author Member

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.

bobdenotter added some commits May 10, 2019

src/Widget/CacheAware.php Outdated Show resolved Hide resolved
src/Widget/SnippetWidget.php Outdated Show resolved Hide resolved

bobdenotter added some commits May 10, 2019

@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

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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
Projects
None yet
2 participants
You can’t perform that action at this time.