Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

checking xsrf before checking cache unnecessarily slows component rendering #7717

Closed
jeffbcross opened this issue Jun 5, 2014 · 0 comments
Closed

Comments

@jeffbcross
Copy link
Contributor

@jbdeboer found an issue in AngularDart which was implemented the same as AngularJS.

Concerning fetching cached templates within $http, the service is checking xsrf tokens before checking the cache for the template, which was adding ~2ms to template load time for each component that used templateUrl. For a page with 500 components in use (e.g. button components in a table), this could add 1s to page rendering time. See:

var xsrfValue = urlIsSameOrigin(config.url)

A nice performance gain can be achieved by moving this xsrf logic to after the cache check.

@jeffbcross jeffbcross added this to the Backlog milestone Jun 5, 2014
jeffbcross pushed a commit to jeffbcross/angular.js that referenced this issue Jun 12, 2014
$http was previously checking cookies to find an xsrf-token prior to checking
the cache. This caused a performance penalty of about 2ms, which can be very
significant when loading hundreds of template instances on a page.

Fixes angular#7717
jeffbcross pushed a commit that referenced this issue Jun 12, 2014
$http was previously checking cookies to find an xsrf-token prior to checking
the cache. This caused a performance penalty of about 2ms, which can be very
significant when loading hundreds of template instances on a page.

Fixes #7717
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant