a page in between

  • פותח הנושא theG
  • פורסם בתאריך

theG

New member
a page in between

Hi All I am new here so Hi. I have a question concerning heavy pages, I have an application, and there are some pages that are very heavy (need a heavy database procedure) I want to have a mid-page that will sow, like... processing your request, and to show the real page only when it is done. does anywone have any idea howto?
 

orenphp

New member
אז ככה...

דבר ראשון ברוך הבא, נקווה שתהנה פה בפורום. בקשר לפיתרון. לדעתי הכי טוב לעשות הוא: להצמיד קובץ HTC לתג body. בקובץ HTC (שלצורך העניין יכתב בJS) יהיה לך תפיסה של הdocument.readyState (אם אני זוכר נכון - תקרא בMSDN), ושם תוכל לבדוק: כל עוד document.readyState != "complete" אז תראה איזה DIV שיוצג בדף, אחרת תעשה לDIV: div_name.style.display = "none" ותראה את התוצאות שאתה רוצה במקום הDIV הזה. זה ממש על קצה המזלג אבל מקווה שהבנת את העיקרון, תתחיל ליישם, במידה ואתה נתקע אנחנו פה. מצטער על התשובה הקצרה, אני חייב לעוף.
 

אמיר ט

New member
Cache Page

what you can do is have a middle page, which will do the job for you. this will only be possible if the page is synamic in a way that an update every 5-10 minutes is possible, so the page a user is viewng is infact up to 10 minutes "old". what u do is have a middle page that run throw a crontab deamon which performes a script which save that page into an HTML file - a static file. then you redirect the user to see that file and not the php file itself... you can use something like :
lynx -dump http://localhost/myfile_gen.php > myfile.html​
in your crontab to run every 5-10 minutes. this will drematicaly erduce the load on the server and the load time of the page...
 

orenphp

New member
רעיון מעולה, אבל לא קשור לשאלה

שלו. תקרא שוב את מה שהוא כתב ותבין. :) בקשר למה שכתבת - יש בpear.php.net מחלקה בשם cachelite שתומכת יפה מאוד בסיפור ומספקת לך כלי נוח מאוד (caching of a page, caching of a function).
 

theG

New member
10x a lot for the answers.

I implemented the first solution, and it works fine (a div that displays until the onload event is called), about the secone solution, its very interesting, but much to much for that metter, anyway I learned sth new. 10x for the warm welcome the G
 
למעלה