Differences between scheduled publish and normal publish
This is the third post on issues I encountered working for Episerver Managed Services and this time it´s about scheduled publish. One question that we got fairly frequent was about the scheduled publish job. Partners had issues of different kind (pages not publishing, cache not working etc.) and it was escalated to us. I find that there isn´t a whole lot documented about scheduled publishing so these are some stuff I learnt directly from the developer team. It covers some differences between a scheduled publish and a normal publish done manually by an editor which publishes the page directly.
The normal publish uses the users context while the scheduled publish runs without the users context and thus it skips the access check. This could in theory mean that a page can be scheduled for publish by a user that isn´t supposed to be able to publish.
The normal publish has access to the HttpContext and the scheduled publish hasn´t, so if a page that´s target for a scheduled publish relies on the HttpContext it will probably have some issues and the publish will most likely fail.
The normal publish fires off the publish event which will invalidate the built-in cache so that all load balanced servers will go to the database to fetch the new content, the scheduled publish however does not fire off that event so other load balanced servers will not get the new content until the pageCacheSlidingExpiration has passed (which is by default 12 hours). This setting can be changed in web.config by adding pageCacheSlidingExpiration anywhere in the applicationSettings tag within the episerver tag, like this: