Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: What's your "must have" plugin?
Bloke wrote #306852:
Not wishing to derail this discussion, but what makes you say that? Serving many files at once off traditional spinning disk (e.g. Pages, Forms, Stylesheets, Images, etc.) burdens the disk controller and read/write heads.
With a separate database server and file server (to alleviate disk head contention on database temp/cache areas), delivering heavy page content from the database and allowing the disk to supply the stuff that’s only stored on disk is arguably more efficient: parallel processing and all that. On top of that, the database can return multiple resources in their entirety in a single query; a disk can’t unless the resources happen to wholly reside in the same sector or block.
Granted, on SSD the distinction is largely moot. It may then be better to serve everything off “disk”, but I haven’t done any performance benchmarks to assess which system is better. Not arguing against the idea, just curious if I’m missing anything.
I would think that static files are cached easier in the browser. We also have fewer db queries. Re images… It is a big subject for a lot of us which I am not touching as it was discussed widely in some threads here. For me there are no plugins which deal with images in a static way – and I can not think of any backward compatible method to do so.
@ Iki
smd is the prefix used by Stef (Bloke) for his plugins.
@ Bloke: +1 for com_connect
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: What's your "must have" plugin?
colak wrote #306868:
I would think that static files are cached easier in the browser.
True: queries are also cached by the DB. Swings, roundabouts… my view is we should offer both and you can choose. Theme support in 4.7.0 is about to land, which helps.
Iki wrote #306861:
So the initials in front of the plugins are the authors mark?
Yes, sorry. Forgot to mention that bit. It’s a legacy thing due to Textpattern internals, but does serve as a nice ‘branding’ benefit that you know who in the community wrote the plugin. For reference, there’s a complete list of prefixes on the docs site.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Online
Re: What's your "must have" plugin?
Bloke wrote #306873:
True: queries are also cached by the DB. Swings, roundabouts… my view is we should offer both and you can choose. Theme support in 4.7.0 is about to land, which helps.
Browser caching is mainly question of headers sent by the server. We could instruct the browser to cache css.php?n=default for one month, it would then not even try to reconnect to css.php (yielding no processing at all), unless the client expressly reloads a page. But this would be a problem when css gets updated. You’ve got the same problem for file-stored css, but Apache has some smart predicting algorithm for cache expiration. So storing css as files is a valid request IMO. But this is not true for pages, forms and other stuff that must be processed by txp anyway. Only IMO again :-)
Offline
Re: What's your "must have" plugin?
As far as I’m concerned, since CSS is not dynamic (doesn’t have Textpattern tags in it) there is no reason to store it in a Textpattern database table. Browsers cache CSS flat files just fine by default, and you should be minifying them anyway so they’d be fairly human-unreadable in the CSS panel. I say ‘them’, you should only have a single CSS file per site in most situations.
If you want to introduce a way to spoof CSS within the database to be seen and handled like a flat file by browsers (and auto minified and auto concatenated) I have no problem with that at all. I won’t need it but I can see benefit of it to others.
Same goes for JavaScript, mostly.
Offline
Re: What's your "must have" plugin?
philwareham wrote #306875:
As far as I’m concerned, since CSS is not dynamic (doesn’t have Textpattern tags in it) there is no reason to store it in a Textpattern database table. Browsers cache CSS flat files just fine by default, and you should be minifying them anyway so they’d be fairly human-unreadable in the CSS panel. I say ‘them’, you should only have a single CSS file per site in most situations.
If you want to introduce a way to spoof CSS within the database to be seen and handled like a flat file by browsers (and auto minified and auto concatenated) I have no problem with that at all. I won’t need it but I can see benefit of it to others.
Same goes for JavaScript, mostly.
This would be my ideal situation and although I will describe it for the css, it would be great if we had it for js as well:
css remains in the database as is but it is also saved as a file in a css folder.
The tag could have a minify option which would just work on the saved file but not the database. This makes it easier to edit the css .
<txp:css format="link" name="plain" rel="alternate" minify="1" title="Plain and simple style" />
<txp:css format="link" name="glossy" rel="alternate" minify="1" title="Glossy style" />
<txp:css format="link" name="print" minify="1" media="print" />
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: What's your "must have" plugin?
etc wrote #306863:
I guess, you would also like to view these “external” images on admin Image tab, right?
No, plain URL only. Maybe a file (or image, article) ID instead, if internal. Or sometimes even a code snippet also, if secured.
Offline
#22 2017-09-06 16:21:43
- GugUser
- Member

- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: What's your "must have" plugin?
colak wrote #306877:
This would be my ideal situation and although I will describe it for the css, it would be great if we had it for js as well:
You have the total freedom to do it this way in a page or a form (the same works for a js-file):
<link rel="stylesheet" href="/css/name.css" />
Or if you prefer it that way:
<link rel="stylesheet" href="<txp:site_url />css/name.css" />
Offline
Re: What's your "must have" plugin?
GugUser wrote #306881:
You have the total freedom to do it this way in a page or a form (the same works for a js-file):
<link rel="stylesheet" href="/css/name.css" />...Or if you prefer it that way:
<link rel="stylesheet" href="<txp:site_url />css/name.css" />...
Hi GugUser,
Not quite. I was suggesting we implemented the rvm_css and spf_js plugins into the core but have an additional minify function for the static file saved.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#24 2017-09-06 18:45:22
- GugUser
- Member

- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: What's your "must have" plugin?
colak wrote #306884:
Hi GugUser,
Not quite. I was suggesting we implemented the rvm_css and spf_js plugins into the core but have an additional minify function for the static file saved.
Oh, so the “minify function” was the point.
Offline
Re: What's your "must have" plugin?
GugUser wrote #306885:
Oh, so the “minify function” was the point.
Yes and No:) There were a number of points
- The ability to edit the css in the db as we are doing currently
- The ability to save that css as a file in the same way as rvm_css does
- The ability to minify the css but only in the saved file and not in the db
- All of the above, but for js (think spf_js +)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#26 2017-09-07 07:51:16
- Iki
- Member
- From: New Hampshire
- Registered: 2008-05-26
- Posts: 22
Re: What's your "must have" plugin?
What does the “minify” function do?
What’s the upside/downside to storing them in the db as opposed to just linking to the .css file in the web directory?
“Some days, even my lucky rocketship underpants don’t help.” — Calvin, Calvin & Hobbes
Offline
Re: What's your "must have" plugin?
Iki wrote #306889:
What’s the upside/downside to storing them in the db as opposed to just linking to the .css file in the web directory?
I think your original ‘favourite plugins’ question got a little sidetracked by the discussion on files versus databases.
Without meaning to tread on anyone’s toes, this is a relatively minor technical aspect and often a matter of preference. The loading speed / caching aspect can make a difference, especially for very large css files, but it is a speed optimisation aspect and not crucial to textpattern:
- Storing in the database means you can access the stylesheet via the Presentation » Styles panel in the admin area using a web browser and can, therefore, edit it online from anywhere.
- Storing it as a file means you can edit it with your favourite code editor with all the extra benefits that brings. And you can also make CSS part of your web development repository using a versioning system (e.g. git or subversion etc.) if you use that. You can also generate it using an SCSS / SASS / LESS preprocessor and run it through a minifier. Generally speaking, you can’t edit it online without your computer.
Plugins such as rvm_css and spf_js allow you to edit in Textpattern’s admin area and save the results as a file that you can serve with a tag. They can also be combined with minification. This method doesn’t play well if you are managing your CSS/js in a versioning system.
What does the “minify” function do?
Minifying crunches the CSS or javascript down to minimum size to reduce loading time. The minified files are no longer human-readable. Typically you develop using CSS and manually or automatically minify the final file for uploading to the server.
TXP Builders – finely-crafted code, design and txp
Offline
Re: What's your "must have" plugin?
Vienuolis wrote #306879:
No, plain URL only. Maybe a file (or image, article) ID instead, if internal. Or sometimes even a code snippet also, if secured.
I’m not sure how (and why) it would fit the current Image tab. Why would you like to mix images, files and articles ids in txp_image table? What you need looks more like a Link for me, but, fwiw, custom image fields are planned in 4.9 (possibly even 4.8).
Offline
Re: What's your "must have" plugin?
etc wrote #306891:
custom image fields are planned in 4.9 (possibly even 4.8).
Good news, thank you very much! Will this apply an article_image, too?
Offline
Offline