Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To Cookie or NOT to cookie, THAT is the question
Message
De
05/10/2003 04:20:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
West Wind Web Connection
Divers
Thread ID:
00822654
Message ID:
00835205
Vues:
31
>Hi Michael,
>
>>It is pretty easy to use StrExtract() and StrTran() to re-write all the URLs before sending the page.
>>I wrote my own ExpandTemplate to get control over stuff like this.
>>In the testing I did, there was no measurable performance hit.
>
>Yes, it's easy if you are in control of the page and know what's inside and what nit. It quickly gets slow when it has to be generic as it would be the case for me (Active FoxPro Pages), because there're many ways to incoporate links into an HTML document, some of them must be expanded, some not.
>
>--
>Christof

Yes, I understand what you are saying about performance.
I was rather worried about that too.

After I changed my site to re-write the URLs just before sending the page out, I was discussing it with one of our best programmers.
He said it would be unacceptably slow.
He was *shocked* when he saw how fast it runs.
I am sure it takes a little time, we just couldn't measure it.

There are multiple sites all running in the same instance of VFP and the same instance of the program.
We parse the URL to know what site it is.
Psuedo-site actually, they are all running on the same IP and are one site in IIS.

Anyhow, to give each site its personality, we change the images path to a site-specific subfolder.
For instance /images/logo.jpg becomes images/mysite/logo.jpg

If the user's browser is not accepting cookies, we re-write all URLs to include the sessionID as a URL parameter.

We also stuff in some http meta headers to force page re-loading.

There is one more thing, but I cannot recall what it is.

Each item takes a few STRTRANs to process because we are forcing the case to upper and to lower so we can tell what strings have been processed yet. It would be easier and more reliable with regular expressions, but it is 100% foxpro and it works fine.

Anyhow, I found it to be very useful, and too fast to get an elapsed time.
I'm glad I did not dismiss it as too slow before I tried it.

How in the heck did the fox team make such fast string manipulation?

Best,
Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform