|
<< Click to Display Table of Contents >> Navigation: Telegram > 2018 > 11 > 08 > Telegram_2018-11-08T05 |
2018-11-08T05:01:09
Hello everyone! I’m new in Intraweb - last half year I create some project : type: link ??.site with rederecting to type: link 16.??.site for high density in the future... But I just can’t catch these errors when testing ... I sending my ServerController here - maybe there are professionals here who can tell me at least in which direction I must go))) ...
I had an idea to use additional thread on the server controller - for my processes - because they are quite heavy - reading users files, etc. - but on the other hand - the Servercontroller is already multi-threaded ...
PS:
I also wanted to ask - I use version 14 - until I can afford the 17th ... tell me - is the page loading speed higher there than on the 14th? I also apologize for many questions - is it possible to make your own error pages if they are inevitable for the user - in Russian?
Have a good day, everyone...
2018-11-08T05:08:44
PS: Sorry for my English??
2018-11-08T05:20:21
To solve this, check type: code SecurityOptions , type: code CheckSameIP := False
2018-11-08T05:21:49
Another thing. In your type: code BrowserCheck you dont need all the tests.
2018-11-08T05:22:07
type: pre procedure TIWServerController.IWServerControllerBaseBrowserCheck(
aSession: TIWApplication; var rBrowser: TBrowser);
begin
if rBrowser is TOther then begin
rBrowser.Free;
rBrowser := TInternetExplorer.Create( 8 );
end;
end; language:
2018-11-08T05:23:23
Ok, grait?? Thank you very much Jose??
2018-11-08T05:23:59
I found it in AtoZed manual - thinked it better to use
2018-11-08T05:25:34
I use it too, but that's enough.
2018-11-08T05:30:05
So, if I leave it - not a problem? - or it will still affect for the speed? I started week ago - my first guests are mostly bots??I prepared the first part for them - I hope correctly?
2018-11-08T05:31:57
For Bots look this demo for better approach:
type: link https://github.com/Atozed/IntraWeb/tree/master/XIV/Delphi/GoogleSearchDemo
2018-11-08T05:33:38
is it ok now?
2018-11-08T05:34:47
Yes, evething is ok for me.
2018-11-08T05:36:04
Another thing. In your:
type: code procedure TIWServerController.IWServerControllerBaseCloseSession(
aSession: TIWApplication);
You don't need anything there.
2018-11-08T05:36:45
IW take care of your US for you.
2018-11-08T05:38:00
Change this:
type: pre ASession.Data := TIWUserSession.Create(nil); language:
to this:
type: pre ASession.Data := TIWUserSession.Create(nil, ASession); language:
2018-11-08T05:38:07
Yes, thanks - I already studied it and did not understand how to redirect to the my type: bot_command /systemmap .xml both type: bot_command /robots .txt because when a bot reads a sitemap it will have to follow the links in its body - so I don’t need to redact it... so I gave up searchengineoption...
2018-11-08T05:42:01
In this fact is that I delete part of the files generated by users during the search on the site and I need to bind to the event - that’s what came up(IWServerControllerBaseCloseSession) - I’m deleting typed files and dynamic arrays here ... and if I don’t delete them - especially arrays, they remain in memory judging by task manager
2018-11-08T05:42:46
You are using GLOBAL Vars?
2018-11-08T05:43:53
I I tried to use
2018-11-08T05:45:03
To protect data for sessions, use in your US:
type: pre private
{ Private declarations }
xEmp001: Integer;
language:
type: pre public
{ Public declarations }
property gEmp001: Integer read xEmp001 write xEmp001;
language:
type: pre procedure TIWUserSession.IWUserSessionBaseCreate(Sender: TObject);
begin
gEmp001 := 0; language:
2018-11-08T05:45:14
I tried to use keep memoty & IWTimers for IWForms - UserSession Destroy
2018-11-08T05:45:21
Never do this in IW.
2018-11-08T05:47:19
So, the best way - to create a new file for users sessions?
2018-11-08T05:48:16
but I liked it so much not to read the base every time??
2018-11-08T05:49:17
Because I don't need to protect data
2018-11-08T05:49:24
for users
2018-11-08T05:50:02
Sorry, protect type: code Vars for sessions.
2018-11-08T05:50:08
it's just a vitrin for my bots
2018-11-08T05:51:33
so - about security - if I don't need to protect it - I can use all my US structure? As I shown?
2018-11-08T05:52:01
The problem is your Vars on US are shared for all sessions you ave.
2018-11-08T05:53:43
so if I will protect it - errors will disappear but I need to make a file for the sessions - right? because I will not be able to use US unit
2018-11-08T05:54:16
type: pre function US: TIWUserSession;
begin
Result := TIWUserSession(WebApplication.Data);
end; language:
2018-11-08T05:54:28
Here the Unit is created for every session.
2018-11-08T05:55:29
if you have to use any var on US, put in every form:
type: code {$R *.dfm}
uses ServerController
2018-11-08T05:55:39
and you are done.
2018-11-08T05:56:47
I understood, ??? US is global for all sessions? I thinkt US generated for each sessions separatly?
2018-11-08T05:57:22
No, every session have you US
2018-11-08T05:57:42
Only GLOBAL Vars is you problem.
2018-11-08T05:57:57
thanks - glad - I did - of course)))
2018-11-08T05:58:38
Remove type: code UserSessionUnit , ServerController do this for you.