| Author |
Topic Search Topic Options
|
dj air
Senior Member
Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
|
Post Options
Thanks(0)
Quote Reply
Topic: Application Veribles and performance Posted: 26 July 2006 at 5:41pm |
|
hi,
i know that storing data within a appliation veribles is a good way of storing data instead of calling a db every generation.
i am working on a reselling interface for a project im setting up.
it will have a Control panel that is skinable at a client/reseller level, to allow for annomonous hosting.
the system uses about 50 veribles to change the skin and text, links etc.
now i could store these in Application(strAliasURL &"_Verible_Name")
this works.
BUT i would have 50 + veribles stored in 50 Plus App Verables.
and bare in mind that is per an account
if can do checks to see if the account veribles are already active else create them.
but i think this wopuld be bad on the server (im creating in shared enviroment but once active onto dedicated)
my other option is an Array stored in 1 Application verible,
but the array of course would be big (50 fields per a user).
these veribles are then inserted into .asp genrated Css file
and while writing this i have just come up with another idea.
i have multiple CSS files,
one per a edit page, so users don't have to edit all 50 + veribloes at once.
so for page one of veribles i have a CSS file created called page one within a Folder named the User_ID.
that way i can then use
css= Import "/" & user_ID &"/Page1.css" css= Import "/" & user_ID &"/Page2.css" css= Import "/" & user_ID &"/Page3.css"
and every time they edit the CSS it then recreates the css file with new values.
i could then store the values within the database for selection (select skin x)
and for loading the edit page.
as you can see im rambling now , sorry, i know the later one is best for performance but can i have views ideas on the top 2, idea 2 is currently active on the website, but the site is still in developement.
|
 |
dpyers
Senior Member
Joined: 12 May 2003
Status: Offline
Points: 3937
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 July 2006 at 6:33pm |
|
I'd distrust application variables in this case if it was a W2K3 server. Too easy for the app pools to get hosed if the server needs a reset or restore and then everyone shares the variables. Your probably dealing with a community that include coders smart enough to do something with exposed app variables.
I'd serialize the variables to a db and load them into ssession variables in a session onstart event or key into them through a cookie.
Anyway you do it, it would probably be a good idea to encrypt account id and payment info.
|
Lead me not into temptation... I know the short cut, follow me.
|
 |
dj air
Senior Member
Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 July 2006 at 6:45pm |
|
thanks,
ive got a 2 way and one way encryption systems,
passwords are one way.
address table = 2 way
the veribles stored will be skin values 99% of them are color codes : #000000
and they are inserted into a CSS sheet.
i think ill have a Encrypted Code thats used within each account to store the CSS as CSS sheets
like my new idea.
it is a W2K3
as session_onstart doesnt always work.
thanks for the info though.
|
 |
dpyers
Senior Member
Joined: 12 May 2003
Status: Offline
Points: 3937
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 July 2006 at 7:52pm |
You know you can use a script exrension for a css style sheet. The first thing you do is set the content type to text/css but then you could intersperse asp and css in the same way that html can be interspersed. The technique lets you accept query string/session/application info and perform conditional css. e.g. - css.asp?skintype=dark
<%Response.ContentType="text/css"%> <% Dim strFG strBG strH1 strH1 = "#ffff00"
Select Case Trim(Lcase(Request.QueryString("skintype"))) Case "light"
strFG = "#000000"
strBG = "#ffffff" Case "dark"
strFG = "#ffffff"
strBG = "#000000" End Select %>
body {color:<%=strFG%>; background-color:<%=strBG%>; }
<% if Request.ServerVariables("LOGON_USER") = "xxxx" Then %> h1 {color:#ff0000;} <%Else%> h1 {color:<%=strH1%>;} <%End IF%> ... other css/asp code
|
Might let you encapsulate all the css conditional processing into the css file and free up the app/server variable space for id info instead of skin info.
Edited by dpyers - 26 July 2006 at 7:55pm
|
Lead me not into temptation... I know the short cut, follow me.
|
 |
dfrancis
Senior Member
Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 July 2006 at 8:19pm |
I've been looking at a new way of doing this without the need for application variables. It's a little more flexible too.
<object scope="Application" runat="Server" id="SokyStats" progid="ADODB.Recordset"> </object>
I'm currently using this in the global.asa file for live statistics. I was thinking about expanding it for site variables. For your application, you could serialize the id for each custom layout. id="skin001"
Then call it simply with...
skin001.Fields("css").Value
Just a thought.
Edited by dfrancis - 26 July 2006 at 8:21pm
|
 |
dpyers
Senior Member
Joined: 12 May 2003
Status: Offline
Points: 3937
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 July 2006 at 8:36pm |
that's kind of slick
|
Lead me not into temptation... I know the short cut, follow me.
|
 |
dfrancis
Senior Member
Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 July 2006 at 9:46pm |
Thanks... been working on it all day but I have been using it in basic form on a high traffic website for 2 years. I'm modifying it to write to a table on session end as well as update in a "common" script so I will know where each user is on the website... live! There are a number of ways I want to use this concept from site variables to session tracking.
Thanks for the nod.
|
 |