Do you have some feature in mind that you'd love to see in Couch? Let us know.
17 posts Page 2 of 2
Hello guys,

I use http://easyautocomplete.com/ and everything works well.

Of course I get the data from Couch no cloning template with <cms:content_type 'application/json'/>
So far so good ...

But I use a lot of products (pages) and I want JSON template to be cached.
There is already a problem here - the end of the page is displayed (quite normal)
-- Cached page --

Easyautocomplete no longer works because the file now contains illegal characters for JSON data.
I expect this situation in any other cases when I will use JSON data.

Can we have a hack (for example, in kfunctions.php) which excludes some cached template from displaying this message?

I ask for your assistance, thanks in advance :)
@Ivo, this can't be hacked via outside function, because the code is written in cms:php # 295+. But it will not be a problem to remove it manually and forget about the issue.

Also, I would like to remind that there is a tag cms:write (viewtopic.php?f=8&t=11377) - and you can "cache" your json manually with it and embed a snippet following a querystring parameter (which will tell what snippet to embed) or feel free to design any other method of using the temporary snippets..
Yes, I know where this message is generated and I can remove it, but the idea is for the Couch to continue to generate the message for the usual cached pages, because it's a good idea.

If another way to circumvent the problem is not found, I will really do that.
I will consider the option with write tag, but I do not know if that will succeed.
There is one hackish workaround. Trick Couch that there is no need to cache the content via some code in kfunctions, then cache it via custom code in the same place and upon next request Couch will serve the cached file, because the check for existent cache file comes before the check for 'need to cache'. I don't really know if it is worth coding that, instead of editing a couple of lines in the core file. It's interesting, because Couch can not check much about cached files and doesn't validate them.. any content can be placed in cache..
Indeed - if something has to be done very complicated it is not worth it. Of course, it's easier for the message to be suspended in cms:php # 295.
But this message is good to have it because it shows one page whether it is cached or not.
I really regret having to lose it ...

I very much hope the КК will make some changes to caching pages - for example:
- Canceling message suspended for some templates (With json data :D )
- By clicking on the Save button not to delete the cache for all pages but only for the page that has been changed - this is very important for sites with 6,000 pages, for example

I believe that other users will be happy with these things
I think adding extraneous text to any non-HTML document was an outright mistake to begin with.

I have tried to rectify this in the latest GitHub commit - it will take the ''Content-Type' of the page (set using "<cms:content_type />" tag) into consideration before trying to add the cached message.

For example, in your case the content-type being 'application/json', the output should not have the cache message added to it any longer.

Please test and let me know if it helps.
Hi KK,

of course everything works well after the change.
Thanks :D
17 posts Page 2 of 2
cron