scyllagroup / UmbracoFlare

This project aims to provide a basic level of service integration between Cloudflare and the open-source ASP.NET CMS Umbraco.
https://www.umbracoflare.com/
Creative Commons Attribution Share Alike 4.0 International
18 stars 3 forks source link

Multiple Sites / Domains? #1

Closed YodasMyDad closed 8 years ago

YodasMyDad commented 8 years ago

Will this package support an install with multiple sites/ different hostnames?

LoganPeck commented 8 years ago

The way UmbracoFlare currently works is that it takes the current url that you are in the backoffice with and ignores the culture/hostnames settings in Umbraco. So without navigating to the backoffice from your other hostname, it is currently not possible. I will say though that the code is there to do it because I was initially thinking that we should go off of the culture/hostnames set in the backoffice. We are currently working on version 2.0 right now. We will really consider reintegrating that functionality. Then when purging the entire site, static files, and urls, we can have a drop down where you select the current registered hostnames in Umbraco. Any suggestions are welcome.

YodasMyDad commented 8 years ago

It's just you have a right click menu on a node to clear cache, and if a site has multiple domains and you just grab the url they are logged in with then you 'could' be clearing a cache for a page that doesn't exist (Not all sites could have the same pages) and some people even login on restricted/editor only domains - So on the main site you can't even get to /umbraco/ for security.

A quick/harsh approach could be to just get the node Url with the domain of the backoffice, then also loop through the umbracoDomains table and clear the cache for all domains listed. This would get everything ;)

Great package by the way, I was going to write our own. But will use this when it supports host names set on the Umbraco nodes.

LoganPeck commented 8 years ago

Yep, excellent points. We will make the changes and will have this support in v2 (in a few weeks). Thanks for the kind words and suggestions. Also, we were at uWestFest and listened to your talk on Merchello. It looks awesome and we will be using it in the future!

jmcaveney commented 8 years ago

Two thoughts on this:

1) We're using IPublishedContent.UrlWithDomain on the publishing/cache clearing but we could very easily just hook into the UrlProvider and get all the domain specific urls for each node. Don't think that's a v2 feature but could be done for a minor release. Here's the code in question: https://github.com/scyllagroup/UmbracoFlare/blob/master/UmbracoFlare/ApiControllers/CloudflareUmbracoApiController.cs#L292

2) The other issue that presents is what to do about static urls and the url entry/wildcard cache clearing in the backoffice umbracoflare section, but I think that could be solved with a domain picker dialog when you click the button to clear.

We can do number 1 quickly, but 2 may take a few days to hammer out the UI.

LoganPeck commented 8 years ago

@YodasMyDad Version 1.1.0 is up on our.umbraco and NuGet. It supports what we were talking about in this thread. Check it out and let me know how it works for you.

YodasMyDad commented 8 years ago

Awesome thanks. We are going to use it on an upcoming project. Will test it as soon as I can.