Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: etc_cache: cache trying hard to be smart
The long awaiting feature in my dreams — congratulations!
Offline
Re: etc_cache: cache trying hard to be smart
Vienuolis wrote #328796:
The long awaiting feature in my dreams — congratulations!
Thank you, I was impatient to share, but there is yet few points to fix. The most urgent one is content type management via file extensions. Currently all pages are stored as html, but txp is capable of producing any content type via <txp:header />
.
Offline
Re: etc_cache: cache trying hard to be smart
Well, this is an expected treat. If it can eventually delegate what pages are stored as flat files that would be great stuff. Static site (and file) generator plus dynamic site generator in one! 😀
Offline
Re: etc_cache: cache trying hard to be smart
This is an insanely awesome idea. And so tiny! Mind blown.
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
Online
Offline
Re: etc_cache: cache trying hard to be smart
What mediatypes are we likely to output with txp? I can see
'text/html' => 'html',
'text/javascript' => 'js',
'text/css' => 'css',
'text/plain' => 'txt',
'application/json' => 'json',
'application/javascript' => 'js',
'application/xml' => 'xml'
What else?
Offline
Re: etc_cache: cache trying hard to be smart
Maybe ‘htm’ for articles, and ‘html’ for index (home, section) pages? Of course, in the same mediatype.
Offline
Re: etc_cache: cache trying hard to be smart
Well, I’m stuck: how to check in .htaccess
whether name.(htm|html|js)
file exists and forward name
to name.(matched_extension)
?
Offline
Re: etc_cache: cache trying hard to be smart
Some additions that may be useful too…
'application/ld+json' => 'jsonld',
'application/xhtml+xml' => 'xhtml',
'text/javascript' => 'mjs'
Offline
Re: etc_cache: cache trying hard to be smart
Very nice! Will play with it soon.
TXP Builders – finely-crafted code, design and txp
Offline
Re: etc_cache: cache trying hard to be smart
etc wrote #328804:
how to check in
.htaccess
whethername.(htm|html|js)
file exists and forwardname
toname.(matched_extension)
?
In theory, the second capture group in (.*?)\.(htm|html|js|etc...)
should map to $2
in the replacement. Does regex not work that way in .htacccess?
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
Online
Re: etc_cache: cache trying hard to be smart
Just to throw extra work into the mix, I’d also need an Nginx version of the .htaccess
rules – sorry!
Offline