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

Faster dashboard and sparklines by closing the session early #7252

Merged
merged 4 commits into from Feb 19, 2015
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Feb 19, 2015

refs #7104

…ajax requests are made within widget or when sparklines are requested
…ion.

Sometimes, eg when module=API, we do not start a session. If any code
part during such a request uses SessionNamespace although we did not start
a session, Zend_Session_Namespace will start a Zend_Session which does not
respect our configuration. It would use default Zend Session options
and therefore probably file based sessions. Therefore, we force the
creation of a "Piwik session". If we have created the session before it
won't be started again.
@@ -466,6 +466,20 @@ protected function prepareDispatch($module, $action, $parameters)
&& ($module !== 'API' || ($action && $action !== 'index'))
) {
Session::start();

Copy link
Member Author

Choose a reason for hiding this comment

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

I was wondering where to put this code here. If we had a Router (refs #6403) it could be maybe related to this. For now I'm ok with having it in FrontController as it is probably not worth it to write an API for this yet.

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Performance For when we could improve the performance / speed of Matomo. Needs Review PRs that need a code review labels Feb 19, 2015
@mattab
Copy link
Member

mattab commented Feb 19, 2015

👍

(small thing, I'll rename Referer -> Referrer in var name)

mattab pushed a commit that referenced this pull request Feb 19, 2015
Faster dashboard and sparklines by closing the session early
@mattab mattab merged commit 3250f48 into master Feb 19, 2015
@tsteur tsteur deleted the 7104 branch March 8, 2015 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants