Revamp the FullNameHash system for better readable urls

And reduce the folders caching footprint.
And it reduces server load.
This commit is contained in:
djmaze 2021-12-07 14:03:30 +01:00
parent 76627ae2f6
commit 3a61bb3e5a
10 changed files with 90 additions and 78 deletions

View file

@ -135,10 +135,11 @@ export class MailBoxUserScreen extends AbstractScreen {
return [
[/^([^/]*)$/, { normalize_: fNormS }],
[/^([a-zA-Z0-9~]+)\/(.+)\/?$/, { normalize_: (request, vals) =>
// Regex the fullNameHash
[/^([a-zA-Z0-9.~_-]+)\/(.+)\/?$/, { normalize_: (request, vals) =>
[folder(request, vals), 1, decodeURI(pString(vals[1]))]
}],
[/^([a-zA-Z0-9~]+)\/p([1-9][0-9]*)(?:\/(.+)\/?)?$/, { normalize_: fNormS }]
[/^([a-zA-Z0-9.~_-]+)\/p([1-9][0-9]*)(?:\/(.+)\/?)?$/, { normalize_: fNormS }]
];
}
}