Hi Guys,
Its not permissions. I finally got some more time to look at this problem again, and I have some results to post. As well as some replies:
@BobRay -- I don't think so. I don't even know what getResources is, but I think its a method on the modx object?
@Frogabog -- I use jQuery's document.ready function. I do have inline javascript code on a few pages, and it would be hard to move it after the </body> tag, because its dynamically generated by snippets. Also, all my configuration uses 192.168.x.x values, dev is 192.168.1.30 and prod is 192.168.1.10. Config.inc.php uses 192.168.x.x as well.
Today I migrated the site again, and I'm still gettting very slow load times on prod. Here's what I've done and what I've found:
I deleted the modx directory at /var/www. I made a new tar of the /var/www/modx directory on my dev server, and new dumps of the modx and client databases.
Previoulsy, I had unpacked the tar in my home directory, then copied it over to /var/www using sudo. This is why the permissions and ownership on the files was wrong. This time I copied the tar and unpacked in /var/www using root. This restored the permissions properly, including ownership of files and directories.
I logged into mysql as root, and used the source command to reload both the modx and the client database. I edited core/config/config.inc.php, changing 192.168.1.30 to 192.168.1.10 on the line for $http_host.
Then I tested the site again. My snippets ran, but it still takes 30 seconds for my main login page to load on prod, vs. 0.25 seconds on dev. I logged in on both sites and compared the results, and found that the REST API login routine on prod ran 4 times, taking 10 seconds where as it ran only once on dev taking less than a second. Strangely enough, everything works on prod, I can login, use the site, etc., but very slowly.
I have a REST API, which (as I mentioned in previous posts) runs fine on both machines. I use jQuery to make an AJAX call to a stand-alone PHP page in the main modx directory, which returns results as JSON strings. I've written a pure HTML/Javascript testing page that makes the same calls, and it runs quickly on both dev and prod. The REST API login routine runs just once from this page.
So I'm still left with a conundrum. Why do I see four calls to my login routine on prod, where I only see one on dev? I'm going to have to turn on more of the debugging to see exactly why this is happening.
I have to say this must be my code. I've only made one other site using Etomite, and the publishing process was basically the same. (BTW, that site was a success, I'm sold on modx.) I know that Revo 2.2 has its own system to handle AJAX calls, but I haven't had the time to study it, and I went with what I knew. Still, I can't see any reasons why this shouldn't just run "out of the box" after migrating it.
I'll post again when I get more results, or fix this. And I will fix this. Again, any replies, questions or suggestions are appreciated...
Signed,
Slow Loading Mrex