How best to update a hosted Kirby site

When I update my hosted Kirby site, I often run into problems. My typical (very complicated) workflow is:

  • make a small change in my local content
  • FTP the content folder to the hosted site
  • since my http://… call to the hosted site often still displays the old content, I manually delete my hosted\site\cache folder.
    • But then the problem happens, that one or more of the files in the \site\cache\[sitename]\uuid folders is locked.
    • Then I have to restart my computer, after which I can finally delete my \site\cache.
    • If that does not work, I have to delete my whole hosted site, and upload all files (including the Kirby installation) again.

There has to be a more simple way to update a hosted site. Can anybody let me what their working work-flow is?

I have figured out that the “locked files” in the uuid-folder (open circled-problemd) were a problem of my FTP-program.

But I still do not know how to effectively update a hosted site, also clearing the cache.

I’m not sure if i have a simpler way than the FTP one because it requires some setup, but once it’s done i would say it becomes easier and safer than the FTP solution.

The required setup is to have your project on a git repository hosted somewhere like github.com. The workflow when adding content to your website would be:

  • Update your content on your computer
  • Save that content on the remote repository by executing some commands on your computer:
git add content
git commit -m "added new content"
git push
  • Connect to your server to update your website by executing a simple command.
git pull

Beware that it is the setup part that could be a bit technical, but using git in a simple way is possible after that.

I haven’t had any problem with the cache with this approach so i guess it solves this too. Clearing the cache can also be done with a plugin like janitor.

Have a nice day!

Sean.

Not sure what’s going on here. But, normally you don’t want to delete the uuid cache.

Just delete site/cache/[sitename]/pages to clear the rendered html. If you still don’t see updated content it may be because of a server side cache (check with your host) or even your browser’s cache.

The uuid cache can be expensive to rebuild, and unless you have a specific reason to clear it you can let it be.

(In the (rare) cases I need to clear the uuid cache, I found that FTP sometimes hangs, times out, or take very long time with those files. I’m guessing here, but that may be because of FTP is bad at handling a large amount of tiny files, or perhaps your site is accessed before the cache has been fully cleared, causing the uuid cache to start rebuilding before the delete operation is completed? If I need to delete I found doing it over ssh works instantly)

If you want a more robust flow rather than manual ftp some people use git deployments like SeanO says and some use scripts with rsync to sync / push and pull updates between local and remote host which works very nicely too.