Sorry if this is not the correct group for my question/suggestion (feel free to move it to another group)!
I am sure that you're all well aware that web hosts nowadays use various caching technologies to speed up websites and handle more visitors. Here at Siteground we also use our custom reverse proxy caching solution which is based on Varnish.
By default Joomla! does not support reverse proxy servers and HTTP caching. To overcome this issue and properly invalidate the cache we created our own caching plugin for Joomla! - it connects to the Varnish cache and it invalidates cache entries when a user creates a new article/menu item or something else. This plugin works for 99% of the Joomla! situations.
There is a problem with Joomla! scheduled articles and Varnish/nginx servers. The issue is that I can create a new article and then set it to be published after 2 days but in this case we don't clear the cache just before the article is posted because there is no action to attach our plugin to. Joomla! uses the following scheme - every time you access a Joomla! site the CMS checks the publish_up field and determines if an article should be displayed or not. To do this the CMS queries the database (even if you have no articles scheduled for posting/removal from the site). I see two issues with this setup:
1. The current solution is not Varnish/nginx friendly and it is almost impossible to invalidate the cache right before the article/module should be posted and enabled on the site. This is caused by the fact that you need a real visitor to open the site and the index.php script to be executed (the PHP script is not executed at all when full page caching is used).
2. The current setup is not optimized because the database is queries every single time a user opens the site and even if there are no scheduled articles. The SELECT query should be modified to check the publish_up field field only if scheduled article posting is enabled (or at least this is how I see things). Image that you have 250K articles and you don't use automatic scheduling - then you simply don't need the additional CPU overhead caused by the SELECT queries. There are many solutions to this issue - even MySQL triggers can be used to change a flag and then articles to be displayed by a cron job.
What are your thoughts on this matter. Please feel free to offer different solutions :)
Kind Regards,
Daniel Kanchev
Web Apps Engineer & Performance/Security Guru
SiteGround Hosting Services
DanielI totally get where you are coming from but I just dont see how it can work in practice (and without changing existing expected behaviour of Joomla)Global switch to support timed postsFor example on my blog I have only ever once had a post set to publish in the future - so I would presumably have set up my site not to support this when i built it 2 years ago and I can guarantee I would have forgotten all about disabling this when it came to the post.
Hourly cronWhat if I wanted to publish at a specific time?
Maybe someone has a cleverer solution that doesnt require me (the user) to think
--To post to this group, send email to joomla-...@googlegroups.com.
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-cm...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-cms.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-cm...@googlegroups.com.
By default Joomla! does not support reverse proxy servers and HTTP caching. To overcome this issue and properly invalidate the cache we created our own caching plugin for Joomla! - it connects to the Varnish cache and it invalidates cache entries when a user creates a new article/menu item or something else. This plugin works for 99% of the Joomla! situations.
@all, I've published a plugin that addresses this very problem we are facing: https://github.com/yireo/plg_system_pendingstate/ The plugin simply introduces a new state "pending" which then allows other plugins (like Daniels Varnish plugin) to use the onContentChangeState event to do their stuff.
This works all pretty ok, except for the issues mentioned in the repos README file. I hope to be working soon on these issues, but any help is welcome. The main thing that prevents it from being a very generic solution is that only articles with state 0 or 1 are shown by default in the Joomla! backend. But if an user knows this, it is very usable. I'm actually going to implement it now on my Yireo site ;)
Regards,
Jisse