Schemas versioning

How can I trigger version change on schemas ?

How do you mean that? Schema changes are always instant.

Hi Sebastian. I need one request api, that can I know that any one updated anything in my squidex. I need that so can I follow the changes and do not send request every time if something has not changed in my content

I still have no idea what you mean. Can you elloborate further?

In every page which uses Squidex, I need to send request to get data.
After first load, when I get data from Squidex, I want to save that in my local store, so that there is no need in the future to get data from Squidex, and I will use from my local Store. But I want to little request from your API, so I can compare my local data version and Squidex data version. And if version is changed, only in that case I will request for new changed data, otherwise, I will use my local.
So what we get. In every page I will ask your API to compare versions, and don’t request all data if version is same.
Thank you.

I see.

  • For servers consuming Squidex you can create a rule that is triggered whenever a content is changed. Then you can push new content to your server and cache it there. You can use web sockets for that or also push the change to a queue like Azure Queue and so on to make the connection between Squidex and your service more reliable.

  • For frontend application (you mentioned local store) this is not possible. In theory this is somehow what GraphQL subscriptions are for (https://graphql.org/blog/subscriptions-in-graphql-and-relay/), but it is very complex to get it done right. Subscriptions do not mention how they should be implemented but the normal approach are web sockets. The problem with web sockets is, that they do not scale well, because you need a persistent connection per user. Of course it is possible, but it is also expensive.

  • So the only option for web browsers is to use etag. Each entity (apps, contents, schema, assets, rule) has a version which is returned in the json response as well as in the header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag. If you add the etag of the cached version to the subsequent requests (If-None-Match: W\YOUR_VERSION>) the API will respond with a 304: Not Modified and does not return the json. But it does not save you that much of performance because the major part (querying the database) has to be done.

Thank you Sebastian, but I try to use If-None-Match: My_Version, and every time server response status is 200. I never get 304.

I mean “If-match”, sorry for that. You can have a look to the frontend, it uses the etags.

1 Like

Look. In my request header I added ‘If-match’: ‘84’. My Content version is 84. Every time response status is 200.

I will have a look, perhaps it is a bug.

HI @Sebastian. Do you have any news ?

I have fixed it and pushed it to master, but it is not deployed to Squidex cloud.

Hi Sebastian. I’m sorry for disturbing, but do you have any news or progress ?

I am still not sure whether you use the cloud or not. I have deployed a new version yesterday but i had to roll it back due to a bug. I hope that I can redeploy tomorrow.

If you have installed Squidex yourself you can try the current dev docker tag: dev-6705

1 Like