Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
We have a fairly standard web development set-up with dev, QA, and prod environments. To smoothly deal with migration through these environments, we've developed a configuration module that has various smarts in it to return the correct data depending on where you are. In dev, file locations, paths, URLs, database info, etc. are based on your individual sandbox settings. In QA, all of these things point to the right places on our QA boxes; likewise with prod.

This all works quite well for us for most config info. However, we've run into a strange situation with mod_perl. If you load config data just once per process, it works fine for pseudo-static information like machine environment and path info. But information that changes per-hit such as the current user (REMOTE_USER) needs to be loaded each time.

From a design perspective, where should that information live and how should it be loaded? Should we 'new' our config module on each hit and include per-hit data there (and re-run all the code), or should a config module contain only data that doesn't change once the process if fired up? Or should we have two modules?

Thanks for any insight.

Update: Did some research based on badaiaqrandista's response and found some information on scope in web apps that gives more detail.


In reply to What config info belongs where for web apps? by cbrandtbuffalo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found