When declaring a service, a URL is specified and cannot change, nor be assigned parameters.
Let's say I have a service declared in "myplugin" with "service.html" as its internal URL, with an optional "page" parameter. When I open the page it's inserted in ("My Page"), I get the URL "http://my.site/fr/my-page.html".
If I want to browse the second page, the URL becomes:
- either "http://my.site/fr/my-page.html?page=2", and the service is not cacheable.
- or "http://my.site/fr/_plugins/myplugin/template/service/page2.html", for instance (if "service/page*.html" is my matcher), which is a plugin URL.
Even if the second case makes the service cacheable, there are several drawbacks as well:
- it's not a page URL, so we have no breadcrumbs, no filters, etc.
- the URL is horribly dirty and does not reflect the sitemap at all.
I would like to be able to have an URL like "http://my.site/fr/my-page/page2.html", which is a clean URL, is perfectly cacheable, and reflects the physionomy of the sitemap.
Of course, it's currently not possible, because this URL is part of the page URL space. Maybe defining a different URL space like "http://my.site/fr/my-page/_page2.html" could solve the problem?
- Conditionne
-
NEWS-23 Urls to navigate in calendar should not be in '_plugins'
-
- Closed
-
or "http://my.site/fr/my-page_ID.html"
the problem is that ID has to be shared between all services in the page !
we could imagine the following solution :
the service do call the same url with _UNIQUEIDENTIFIER + ?paramformyservice=values
so the page will be cachable and the small unique identifier does not need to reflect all param value (it could be a hash code of them)
ex:
if you go on page 2 of my service, I build a hashcode based on my zoneitem and the my parameter (page 2) e.g. N2352
Then I call the page fr/page_N2352.html?page=2
The first time the parameter is used to build the cache and ignored the second time