I have some javascript variables that I want to include in an asp.net page. These are built up in code. I am using these variables in my client side code.

I am wondering is the better approach. 

A. Create a httphandler that processes the logic for the variables and handler returns javascript. A reference to handler is included in the master page

B. Master page code behind processes the logic for the variables and returns in the pages markup.

These variables are required on every page. 

I am wondering which is the best approach from a performance and best practise point of view.

Reason I like the handler is that it means no javascript is included with markup, total seperation. But the drawback of the handler is that it means an extra http request and may slow down page rendering while the handler is processed.

Opinions?