-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data URL Routing: Short URLs cannot be resolved 60 seconds after last use. #339
Comments
Hi David You can register the internal url (~/buildings(id)) to actual url on startup instead of relying for the cms to discover the binding. A code example can be found here: Something like: |
I've just updated to C1 v6.2, and I'm still seeing This is occuring for Page Datafolder datatypes loaded via a Razor functions like this one:
Do I need to add something else? I'm finding the documentation a bit vague. |
Is the Razor function added to the page that has the data folder below it, and will the function always run? |
Yes, and Yes. |
No, it shouldn't make a difference. |
I tried reproducing the issue without any success. There're a few limitations I've found out -> a web request is used internally to execute related pages. So if site isn't reachable via hostname from the server where it is hosted, or the site is load balanced, the feature may not work as intended. It would be better to render the page internally without going through network, but it would be much easier to achieve once we got rid of WebForms handler we are using now, I will take another look at it once we have "rendering without ASP.NET web forms feature" down. I've added some extra logging that can help should the problem be related to rendering a page. The workaround I've mentioned in the comments previously should help (registering the url route on startup with C#) |
I have a Page Datafolder with the Short URL name set as "buildings". I have also created a Razor function for my Building page (at ~/Our-Buildings) which enables Data URL Routing using the
RoutedData<T>
type.According to the documentation, this means that I can link to the routed page using just this:
<a href="~/buildings(Id)">link</a>
... where the Id is a valid GUID for the datatype record.
Most of the time this works fine. If I link to a datatype record from another page in my website, the page rendering engine resolves the link stored in the page to the correct URL: ~/Our-Buildings/Main-House
However, If I haven't browsed to the page at ~/Our-Buildings (or one of the datatype record pages) for 60 seconds, the URL isn't resolved any more by the page rendering engine... i.e. the when I use "view source" in my browser, the URL remains as ~/buildings(Id).
In other words, it appears that Short URLs are only cached for 60 seconds, before being forgotten by the rendering engine. Is there a way to fix this so that I can consistently use these ~/building(Id) links?
The text was updated successfully, but these errors were encountered: