1
votes

I'm running cakePHP 2.3.5 on a LAMP stack, with DebugKit.

For some reason, the resources loaded by DebugKit (e.g. the js files, css and the small image) are all taking forever to load.

e.g. I have a copy of jquery.js on the site anyway, which loads locally in 6ms. DebugKit also likes to load it's own personal jquery.js, but according to Chrome's network profiler this takes 14 seconds to load!!

It's only resources within the debugkit plugin directory doing this, everything else is fine.

Note also I do not have this problem when using XAMPP on Windows 7, but since I moved development to LAMP this has been an issue.

Any ideas?

1

1 Answers

3
votes

Symlink website assets

For a request for a static file to be taking 14 seconds - the request is not matching a static file, and is being served by the dispatching process. As noted in the documentation:

keep in mind that handling static assets, such as images, Javascript and CSS files of plugins, through the Dispatcher is incredibly inefficient

The normal/correct way to install any plugin is to ensure that all requests for plugin assets, hit a static file in the webroot with a symlink:

App
    Plugin
        DebugKit
            webroot
    webroot
        debug_kit -> ../Plugin/DebugKit/webroot

Via a command similar to:

cd App/webroot
ln -s ../Plugin/DebugKit/webroot debug_kit

On windows, simply copy the folder.

If in doubt directly load it's own personal jquery.js (probably the url /debug_kit/js/jquery.js) and look at the result - before and after having created the symlink (or copied the folder).