• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Some questions

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
5 posts • Page 1 of 1

Postby NetAndif » Wed May 24, 2006 8:46 pm

Hi, thanks for this lovely chat. I like it very much.
Currently i only have one question: will it increase performance to use different files for client + server scripts?

NetAndif
NetAndif
Member
 
Posts: 21
Joined: Wed May 24, 2006 8:21 pm
Top

Postby phpfreechat » Wed May 24, 2006 9:18 pm

Sorry but I don't understand your question at all :(
Could you explain a bit more ? :)
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby NetAndif » Wed May 24, 2006 9:46 pm

Ok, i'll try to explain ;-)

In your demo3 you are using seperate files for the 'client', 'config' and 'server' php scripts. I understand that it is useful to put the config in a seperate file.
I also understand that the 'client' script in this demo will be the php file which the user opens in his browser, whereas the 'server' php script will be called by ajax.
My question is, if it will increase server load to use only one script for both.
E.g. all the client side script will be executed each time when php is called by ajax.
Last edited by NetAndif on Wed May 24, 2006 9:50 pm, edited 1 time in total.
NetAndif
Member
 
Posts: 21
Joined: Wed May 24, 2006 8:21 pm
Top

Postby phpfreechat » Wed May 24, 2006 10:01 pm

NetAndif wrote:My question is, if it will increase server load to use only one script for both.
E.g. all the client side script will be executed each time when php is called by ajax.

When using a single script, AJAX will call it but when phpfreechat object is created, it will just stop the script and never execute the code after the phpfreechat object creation (I speak about : $chat = new phpFreeChat($params)).
So for each AJAX call, the code before the phpfreechat object creation will be executed.

Using separate client/server script is interesting when you need to do something before.
For example when integrating the chat on a website with registred user, you don't want to allow anonymous people to come on the chat without beeing registred. For this kind of case separate the client and the server script is a good choice.

I think for most of common cases a single script is enougth.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby NetAndif » Wed May 24, 2006 10:11 pm

Well, this made it clear to me.
Now i know, if i need external config includes (e.g. for rewrited URLs and logged in users), i should put them into the 'client' script, because this will only be loaded once when the user opens the chat. Then the server-script will be used to update the chat by AJAX.

Thanks again.
NetAndif
Member
 
Posts: 21
Joined: Wed May 24, 2006 8:21 pm
Top


Post a reply
5 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 6 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub