0

I have two websites.

On website 1 I have a calendar showing upcoming events. Next to a regular views page I also created a views rest export page with 6, of the most near in the future, upcoming events.

On website 2 I created a rest import function with JavaScript. Getting the 6 events and showing them in a block.

Now my problem is that, when a day is passed and an event has taken place, the event is not removed from the block in website 2. I'm not caching anything on website 2 and it is just importing the rest export every time the page loads. And I turned the cache of the view on website 1 off.

It looks like the problem is with website 1 (because emptying the cache on website 1 fixes the problem on website 2 for some reason it is not updating the rest export when an event has passed.

The updating of the rest export on website 1 should take place because the filter of the view is set to only show the upcoming events.

I find it hard to explain what the problem really is hopefully my explanation makes sense (at least a little bit).

So what I'm wondering if this is a normal behavior? Did I miss a setting?

1 Answer 1

1

These things would be easy to solve if you could set a cache expiration time for anonymous requests in UI, but you can't unfortunately. See Page cache not rebuilding after page cache maximum age is reached

In this case you could add an additional query parameter containing the current date when website 2 is requesting content from website 1 with javascript. This would create a new cache entry on every date change in the page cache of website 1, even if the query parameter is never used. You need to disable caching of the View itself so that it doesn't get cached in other places.

1
  • Thanks, adding ?date= with todays date to the url is working perfectly.
    – Joost
    Apr 15, 2021 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.