Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#85 2021-06-14 07:13:02

etc
Developer
Registered: 2010-11-11
Posts: 4,432
Website GitHub

Re: etc_cache: cache trying hard to be smart

Ah. Have you downloaded the zipped etc_cache version?

Offline

#86 2021-06-14 07:42:25

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 180
Website

Re: etc_cache: cache trying hard to be smart

I was trying so many different things back and forth to get it working… I currently had the non-zipped version installed. Now I have version 0.5.3 and I see the advanced option. I put it to static files.

Everything is working better now but I still experiencing problems.
At least the “unpredictable” behaviour seems to be gone since using the correct version.

When editing now an article of the filtered section {“article_saved”:{“Section”:“jobs”}} it flushes the cache as expected. But when calling the url /jobs/ to regenerate the cache I get a blank page. Only reloading again shows the correct page and cache is created.

My goal would be anyway to overcome this step of the “manual” refreshment of the cache. For my purpose it would be best that the cache is generated somehow automatically in the moment the article is saved.

Offline

#87 2021-06-14 07:54:30

etc
Developer
Registered: 2010-11-11
Posts: 4,432
Website GitHub

Re: etc_cache: cache trying hard to be smart

demoncleaner wrote #330463:

When editing now an article of the filtered section {“article_saved”:{“Section”:“jobs”}} it flushes the cache as expected. But when calling the url /jobs/ to regenerate the cache I get a blank page. Only reloading again shows the correct page and cache is created.

Interesting. Some web hosts or CSP rules block automated requests, requiring User-Agent or other headers. Have you anything like this in access logs?

Offline

#88 2021-06-14 11:42:22

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 180
Website

Re: etc_cache: cache trying hard to be smart

I do not use any headers because it is just HTML-snippets that I wanted to create and integrate into my shop. But giving the database-cache-version of etc_cache a try made me realize that at the end it is more complicated using a caching-system to achieve what I want, when I can instead just look up the textpattern table directly and get the data from there. The approach is a bit different but it works pretty well. I just cannot use forms inside articles. But I can live with this.
Thank you anyway because you brought me on the right track.

Offline

#89 2021-06-14 15:43:09

etc
Developer
Registered: 2010-11-11
Posts: 4,432
Website GitHub

Re: etc_cache: cache trying hard to be smart

Sure, there is no much point in storing data on disk rather than in db if you retrieve it via an application. The aim of static cache is to bypass any processing and serve static web pages directly to the client.

Anyway, that was an occasion to revisit etc_cache, so version 0.6 is out. It allows for setting cache update filters automatically on cache creation, without visiting the admin interface. If additionally you write a tiny admin-side plugin that pings the article’s URL on new article post, txp will become a (simple) static site generator, updating relevant pages when needed.

Offline

Board footer

Powered by FluxBB