Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-12-07 21:51:23

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

What are the tradeoffs in using the plugin cache directory?

I have never used the plugin cache directory. Does it offer better performance than installing plugins via the Plugins tab? Is it a better way to do things, for developers who want to master it? Or is it just different?

Offline

#2 2016-12-07 22:31:25

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: What are the tradeoffs in using the plugin cache directory?

For developers, if they want to modify the plugin directly without going through the built in TXP plugin edit screen.

As for performance, try benchmarking it with either a lot or a huge plugin(s) (comparing cache directory to regular plugin install). I’m interested in the results.

Offline

#3 2016-12-08 10:46:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: What are the tradeoffs in using the plugin cache directory?

Advantages:

  • You can drop a plugin’s template .php file into that directory without compilation. Handy when pulling bleeding-edge plugin changes off GitHub between official releases.
  • Easier to integrate with version control software.
  • As Ruud says, you can edit the plugin directly in your favourite IDE/text editor and the changes are reflected immediately without needing the Txp interface.
  • Plugins are “always on”. No enable/disable required.

Disadvantages:

  • Plugins are “always on”. They need to be deleted (or moved) from the directory to stop them running. An example where this may (or may not!) be an issue is rvm_maintenance. It’s primarily the reason smd_at_work exists, as the latter is toggled from a dedicated UI button instead of just by toggling the plugin enable/disable status.
  • Plugins don’t respond to lifecycle events. Any that are written to solely respond to such events may not install database tables or prefs properly, which can cause issues.
  • If you have a lot of plugins and your hosting is on spinning disk, it can generate a fair amount of disk head movement and you may experience a bottleneck as they are loaded. Most plugins are relatively small (compared to disk block sizes) and probably reside on a limited number of disk sectors, so this might not be detectable. If you’re running on SSD, this is probably not an issue.
  • Plugin load order is not acknowledged. Plugins are loaded in alphabetical order, so if you need to alter the load order, you have to rename the file accordingly. This can cause issues with library plugins (e.g. smd_lib is required for smd_gallery, but will be loaded afterwards).

The beauty is you can mix and match. Some in the DB, some on disk according to your needs.

Ya pays yer money, ya makes yer choice.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB