# How to define a struct that only need one time initialization and used for every request

**URL:** <https://www.ruby-forum.com/t/how-to-define-a-struct-that-only-need-one-time-initialization-and-used-for-every-request/226369>\
**Category:** NGINX\
**Created:** [July 22, 2012, 12:37am UTC](https://www.ruby-forum.com/t/how-to-define-a-struct-that-only-need-one-time-initialization-and-used-for-every-request/226369 "2012-07-22T00:37:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walter\_Chang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/73ab20/32.png) [@Walter\_Chang](https://www.ruby-forum.com/u/Walter_Chang)\
**Post date:** [July 22, 2012, 12:37am UTC](https://www.ruby-forum.com/t/how-to-define-a-struct-that-only-need-one-time-initialization-and-used-for-every-request/226369/1 "2012-07-22T00:37:57Z")

</div>

Hi ,

I’m new to server development. I have a c++ struct that need to be  
initialized once from file and it will be used in each request since the  
data it has is read only. I’m not sure what’s the best practice to  
define  
that struct in nginx module.

Shall I put it in the module loc config or just define it as a global  
variable ?

Thanks,

Weide
