IIS ASP - Best practices for cookies in classic ASP - memory usage

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > May 2007 > Best practices for cookies in classic ASP - memory usage





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Best practices for cookies in classic ASP - memory usage
MartyN

2007-05-30, 1:25 pm

When using cookies in classic asp, is it safe to assume that using a
comma delimited list of values in one cookie is much more efficient
than using multiple cookies? (example below)

Response.Cookies("someCookie") = "101,102,103,104,105,106"
If InStr(Request.Cookies("someCookie"),"103") > 0 Then.......

vs.

Response.Cookies("101") = "True"
Response.Cookies("102") = "True"
Response.Cookies("103") = "True"
Response.Cookies("104") = "True"
Response.Cookies("105") = "True"
Response.Cookies("106") = "True"
If Request.Cookies("103") = "True" Then.....


Thank you!

Anthony Jones

2007-05-30, 1:25 pm


"MartyN" <MartyNg@gmail.com> wrote in message
news:1180529614.119866.280390@k79g2000hse.googlegroups.com...
> When using cookies in classic asp, is it safe to assume that using a
> comma delimited list of values in one cookie is much more efficient
> than using multiple cookies? (example below)
>
> Response.Cookies("someCookie") = "101,102,103,104,105,106"
> If InStr(Request.Cookies("someCookie"),"103") > 0 Then.......
>
> vs.
>
> Response.Cookies("101") = "True"
> Response.Cookies("102") = "True"
> Response.Cookies("103") = "True"
> Response.Cookies("104") = "True"
> Response.Cookies("105") = "True"
> Response.Cookies("106") = "True"
> If Request.Cookies("103") = "True" Then.....
>
>
> Thank you!
>


The former is more effecient than the latter. Whether it is 'much' more
effecient depends on the real world usage but creating multiple cookies will
increase the size the requests being made to the server.


Egbert Nierop \(MVP for IIS\)

2007-05-30, 7:20 pm


"Anthony Jones" <Ant@yadayadayada.com> schreef in bericht
news:O9nx6GsoHHA.4424@TK2MSFTNGP03.phx.gbl...
>
> "MartyN" <MartyNg@gmail.com> wrote in message
> news:1180529614.119866.280390@k79g2000hse.googlegroups.com...
>
> The former is more effecient than the latter. Whether it is 'much' more
> effecient depends on the real world usage but creating multiple cookies
> will
> increase the size the requests being made to the server.


Hi!

In fact, each separate cookie is just one line in the HTML document as a
pre-content HTML-header. This is defined in RFC's and does not cost a lot
more resources or CPU.
It does not do a separate Server request (HTTP)
HOwever, since ASP is a script language, theoretically a Request.Cookies
statement is slower than a single Request.Cookies statement which can be
splitted into an array.
I would just choose the most convenient way of programming!

The most performance scalability is gotten by desiging good SQL scripts and
commands.
--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com