jordanleven / force-refresh

Force Refresh is a simple plugin that allows you to force a page refresh for users currently visiting your site.
https://wordpress.org/plugins/force-refresh
6 stars 2 forks source link

suggestion, create and poll on static file instead #716

Open andretsb opened 6 days ago

andretsb commented 6 days ago

I think it might be better to have the plugin write out a static file that the clients poll, because right now having the polling request go through PHP and wordpress is a huge scalability problem, especially if your site is already a little slow. Static files however are much more light weight to serve.

Maybe easier to implement alternative to doing web sockets?

jordanleven commented 6 days ago

Yeah that's a good idea. WordPress does have some cacheing support on DB queries but writing to a static file would be quicker. For right now, WebSocket support is off the table since not all servers may be equipped to handle that.

If you're interested in adding support for storing versions as static versions, PRs are welcomed!