This is how I do it as a FormIt hook:
$wsw = false;
$userId = $modx->user->get('id');
$mySettings = array_merge(array(
'createdby' => $userId,
'published' => '1',
'publishedby' => $userId,
'publishedon' => time(),
'richtext' => 0,
'template' => '3',
'unpub_date' => time() + 2419200,
), $hook->getValues());
$newResourceObj = $modx->newObject('modResource', $mySettings);
$newResourceObj->set('alias', $mySettings['pagetitle']);
$newResourceObj->set('refreshURIs', true);
/* must return true or false for Formit Hooks to work */
$wsw = $newResourceObj->save();
return $wsw;
This is from a classified ads site I through together in two days last year.
The pages are created by the user filling out a form, injected into MODX, and the user is presented with a link on the Thank You page.
But this is a page by page bases.
To do all the pages in the site I suspect a Snippet which retrieves a collection of published modResources, loops through the array of objects, and runs the internal process function should do it.
<?php
$collection = $modx->getCollection('modResource', array('published' => '1'));
if ($collection) {
foreach ($collection as $obj) {
$obj->process();
$modx->cacheManager->generateResource($obj);
}
}
After some hackery I through this together. Seems to work, but I wouldn't have that on a public page.
By the way, IIS is much heavier on a web site, and the slowness you are experiencing can be a combination of any of the myriad of configuration settings on the server, domain controller, network, firewall, etc.
It could also be due to a heavy system load. The number of visitors your site is experiencing is of little consequence, as that is only a few per hour.
I would have the "Admin" look at the server load and find out what processes is dogging the server out. Tell them to turn off indexing on the website content as that is a waste of resources. There are dozens of other things that I can recommend, but he is in the position to know how to do it and look into it.
[ed. note: wshawn last edited this post 13 years, 4 months ago.]