Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tam1's avatar
Level 8

Maintaining sync of frontend and backend.

How do you guys maintain sync of your frontend and backend in cases where you deploy new code that possibly changes an api endpoint, or do you not worry about this?

A few ways that I have handled this is

  1. By creating versions for my API so that when an old version of the frontend is still used, it pings the old version of the API as well. When the user refreshes, they will get the new version of both.
  2. My current setup is using Redis and Node. When I deploy I am able to ping Redis the new version, and Node listens to that and emits an event to our frontend clients to refresh the browser.

The issue I have with Idea #1 is that this might apply to something other than my API. For example, it could be a sign up page where I change the way the UserRegisteration process behaves. In this case, I would have to version all your controllers rather than just the API controllers, which seems excessive. I like Idea #2 and it seems like the approach pivotaltracker.com has taken as well.

How might you guys handle situations like this?

PS: I realize that this is not necessary for most apps, but it's quite important for ours as our clients tend to leave the site open for a few days the need to refresh.

0 likes
0 replies

Please or to participate in this conversation.