Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2021-02-12 08:06:40

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 310
Website GitHub GitLab Mastodon Twitter

Re: etc_cache: cache trying hard to be smart

The long awaiting feature in my dreams — congratulations!

Offline

#26 2021-02-12 08:19:39

etc
Developer
Registered: 2010-11-11
Posts: 5,186
Website GitHub

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

#27 2021-02-12 08:49:39

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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

#28 2021-02-12 09:10:38

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

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

#29 2021-02-12 09:22:11

etc
Developer
Registered: 2010-11-11
Posts: 5,186
Website GitHub

Re: etc_cache: cache trying hard to be smart

Bloke wrote #328799:

And so tiny!

Wait…

Offline

#30 2021-02-12 09:31:30

etc
Developer
Registered: 2010-11-11
Posts: 5,186
Website GitHub

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

#31 2021-02-12 09:57:03

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 310
Website GitHub GitLab Mastodon Twitter

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

#32 2021-02-12 10:07:32

etc
Developer
Registered: 2010-11-11
Posts: 5,186
Website GitHub

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

#33 2021-02-12 10:12:32

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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

#34 2021-02-12 10:53:16

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

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

#35 2021-02-12 11:05:35

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

Re: etc_cache: cache trying hard to be smart

etc wrote #328804:

how to check in .htaccess whether name.(htm|html|js) file exists and forward name to name.(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

#36 2021-02-12 11:12:50

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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

Board footer

Powered by FluxBB