[TYPO3-core] RFC: #7333: Solution for "Page is being generated"

Ingmar Schlecht ingmar at typo3.org
Fri Feb 1 23:48:17 CET 2008


Hi Bernhard,

could you please also summarize how your patch solves the problem that 
was historically solved by PIBG? So what exactly happens with your patch 
if two visitors hit your page at the same time after you cleared the 
cache? Does the second visitor "wait" for the first visitor's process to 
finish generating the page? And what if three people hit the page at 
nearly the same time, will it sill work? I only had a brief look at the 
patch.

Some more comments:
  * Please use more speaking variable names, $lockfd => $lookFilePointer,
    etc. What does FD stand for? Shouldn't it be FP for filePointer?
  * Automatically create the directory pagegen_locks if it's not present
    already

cheers
Ingmar


Bernhard Kraft wrote:
> Hi all !
> 
> This is an SVN patch request.
> 
> BT:
> http://bugs.typo3.org/view.php?id=7333
> 
> Problem:
> Get rid of this "Page is being generated" screen ...
> 
> Solution (copied together from thread to typo3.dev):
> http://lists.netfielders.de/pipermail/typo3-dev/2008-January/027357.html
> ----------------------------------------------
> I think I found a solution for the well-known and annoying problem that
> in some situtations you get a:
> 
> "Page is being generated"
> 
> message when requesting cached-pages. For non-cached pages this problem
> does not exist. But for cached pages in some cases this "message" gets
> generated - some people even think it is some kind of "error message".
> 
> [...]
> 
> When I started to debug this problem I first created a test-environment.
> You can download it from here:
> 
> http://think-open.org/kraftb/index/page_is_being_generated/cachetest_v1.tar.gz
> 
> http://think-open.org/kraftb/index/page_is_being_generated/PIBG_patch_v1.diff
> (PIBG = PageIsBeingGenerated)
> http://think-open.org/kraftb/index/t3_cachetest.tar.gz
> 
> included are three html files:
> * cachetest.html
> * loaded.html
> * info.html
> 
> Just copy those three to the web-root of your typo3-installation - and open
> "cachetest.html" with a browser.
> 
> .... there are a few things you have to take care of for the debugging
> environment:
> 
> *1* You have to be logged in into the BE (the script is clearing the
> site-caches
> automaticall - else you would have to click both clear cache buttons
> manually
> after each test-run (just check those 3 html file's JS - it isn't doing
> anything bad)
> 
> *2* The test-environment hast to get untared into the webroot of the
> site you
> are going to test ...
> 
> *3* If you would like to test a site "without" having the whole patch
> applied you
> at least have to add the line
> 
> -------------
> unset($_GET['cachetestFrame']);
> -------------
> 
> 
> normally delay value shoule be between 500 and 2000. The script is loading
> the start-page of your website into the left-frame - and then after the
> given delay it
> loads the start-page a second time into the right-frame ....
> 
> try this a few times - you can click the button again after both frames
> have loaded.
> and try to vary the delay (upper input field) - and in some situations
> you will get a
> "Page is being generated" message in the right frame (Of course only if
> your startpage
> isn't set to "no_cache") ...
> 
> 
> Comparison:
> ===========
> This are .png files showing the test-environment with the patch enabled:
> 
> http://think-open.org/kraftb/index/page_is_being_generated/fixed_100.png
> http://think-open.org/kraftb/index/page_is_being_generated/fixed_500.png
> http://think-open.org/kraftb/index/page_is_being_generated/fixed_5000.png
> * ... just have a look at them. I marked the important times with a red
> box ... *
> 
> And without patch enabled:
> 
> http://think-open.org/kraftb/index/page_is_being_generated/unfixed_100.png
> * 100 ms delay. The page is completly generated and stored into page two
> times *
> 
> http://think-open.org/kraftb/index/page_is_being_generated/unfixed_500.png
> * 500 ms delay. In the right frame you get the page is being generated
> message cause
> the left frame already handled to put the tempPageCachedContent into cache*
> 
> http://think-open.org/kraftb/index/page_is_being_generated/unfixed_5000.png
> * 5s delay. Both frames get rendered indepently. The right one gets
> fetched from cache *
> ----------------------------------------------
> 
> 
> Additional: Instead of just using "flock" the patch should try to
> use mutex-locks if available (better thread safety) and just use
> file-locks as a fallback.
> 
> 
> greets,
> Bernhard
> 


-- 
Ingmar Schlecht
TYPO3 Association Active Member


More information about the TYPO3-team-core mailing list