Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Application Veribles and performance
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Application Veribles and performance

 Post Reply Post Reply
Author
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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.



Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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.


Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
dfrancis View Drop Down
Senior Member
Senior Member


Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
Post Options Post Options   Thanks (0) Thanks(0)   Quote dfrancis Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2006 at 8:36pm
that's kind of slick 

Lead me not into temptation... I know the short cut, follow me.
Back to Top
dfrancis View Drop Down
Senior Member
Senior Member


Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
Post Options Post Options   Thanks (0) Thanks(0)   Quote dfrancis Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.