Production Mode requires a save every time

  • Hi,


    Greetings to the new forum!


    I have a problem whereby I am in Production mode but any change to a Perch template or linked file from a Perch template requires me to save when previously this has not been the case.


    Is this the expected behavior since it is really tiresome having to upload an entire database just for really small changes, especially when this was not required previously and was a great feature that appears to be trashsed for no good reason.


    Cheers

  • drewm

    Approved the thread.
  • I have a problem whereby I am in Production mode but any change to a Perch template or linked file from a Perch template requires me to save when previously this has not been the case.

    It's always been the case (since pre-v1) that a standard perch_content() region saves its HTML output at edit time and won't update until it's next saved.


    That's not the case for perch_content_custom() calls, as they are generally dynamic and therefore rendered from the template live.


    None of this behaviour has changed. One thing that has changed in recent times is that PHP is now much more aggressive at caching the content of your files in recent versions. When you put Perch into development mode, we perform a few tricks to clear the PHP cache so that file changes show up instantly as you're working. You obviously want this caching behaviour in production as it makes your site faster and reduces load on the server.


    You can test out if this is what you're seeing by just waiting it out for a few minutes next time you see a change not taking effect.



    Is this the expected behavior since it is really tiresome having to upload an entire database

    You've lost me here... you're uploading a database?!

  • Hi Drew,


    Thank you for replying with your thorough explanation.


    I cannot seem to fathom the problem since I am using AMPPS and it hasn't been updated for a long time, in other words the only thing I have updated recently is Perch.


    As for uploading an entire database, I haven't checked whether this is strictly necessary between local and internet web servers but I assumed it would be since it was happening locally at least.


    My config.php files on both systems are in Production mode and while I'd like to take advantage of a having the fastest possible caching in PHP, my templates are always in development as I use a great amount of Media features and alas Web Components aren't really here and Perch offers the perfect balance between templated and custom content.

  • Hi Drew,


    I mistakenly wrote that I was in Production mode, when in fact I am always in Development mode hence my question since I was of the belief that Development mode, literally meant that nothing was cached and therefore a simple refresh of a page meant that any changes to an underlying template or PHP code would mean that all data would be retrieved anew.


    There are some occasional problems re-ordering <perch:block/> elements however since I have changed my AMP stack, problems elsewhere have not surfaced as of late.


    Thank you for supporting such a meaningful CMS.


    Cheers