I am making a section for website, with changeable info from admin panel, but the info won’t change so much, so the section shouldn’t be dynamic. I’m intended to generate html on info change, but to store all the html in one variable with "" it gets messy. So maybe there is another way to do this, so its more maintainable?
I am making a section for website, with changeable info from admin panel, but
Share
Just cache the site in a way that the cache will be hit first:
This builds a regular dynamic HTML/PHP page and writes that page into an .html file in the webroot, which will be hit directly the next time. In your admin interface you just need to delete this cached version whenever you update the information. The above script is invoked only if the .html version does not exist through .htaccess rewrite rules, e.g.:
So the logic works like this: