-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
The model class used for resources (info.magnolia.module.resources.Resource) currently generates its "far future caching" links with dots, e.g /resources/foo/bar.2015-05-22-16-00-35-123.cache.css.
This is then "converted" to using ~ by a virtual URI configured in the cache module, which was added via MAGNOLIA-4207 (SCRUM-699).
Finally, the RepositoryMappingFilter strips out the ~ from the current uri set in AggregationState, and sets handle and currentNode.
While convoluted, this works, as long as we load resources after this filter, e.g with the rendering mechanism and the special Resource*Renderers.
If we serve resources via a Servlet, the current uri in AggregationState still has ~'s in it, since servlets are interrupting the filter chain before it reaches the RepositoryMappingFilter. Besides, using a servlet has the added benefit that we can use pathInfo (as opposed to the complete URI, which includes the path to the servlet).
Suggested approach:
- fix info.magnolia.module.resources.Resource: use ~ directly, no reason to use .
- remove now-unnecessary virtual uri mapping from cache module (see
MGNLCACHE-106) - future: review filter chain. RepositoryMappingFilter and a few other filters have responsibilities that belong somewhere, and/or are simply wrongly named. See MAGNOLIA-6217.
Essentially, this is all due to MAGNOLIA-2343, which we've ignored until now.
Meanwhile, we should also factor out the far-future-link generation:
- info.magnolia.module.resources.servlets.ResourcesServlet#stripFarFutureCachingTimestamp
- info.magnolia.module.resources.Resource.getLink()
- info.magnolia.cms.util.LinkUtil has the methods we want but is unused except in DefaultImageProvider (which is probably a good thing, because neither name nor location of this class are good)
We'll also need to investigate browser cache, i.e /modules/cache/config/configurations/default/browserCachePolicy/policies/farFuture/voters/dotCacheExtension
- is causing
-
MGNLCACHE-106 Remove unnecessary tildeCacheResources from Cache module, fix browser cache config
- Closed
- is depended upon by
-
MGNLRES-157 Update uses of renamed TemplatingFunctions methods
- Closed
-
MGNLRES-144 Implement new origin-based ResourcesServlet
- Closed
- is duplicated by
-
MGNLRES-197 FarFuture caching needs rework of the concept: reference resources and the scriptloadres won't change modification date
- Closed
- relates to
-
MAGNOLIA-4207 Fix the cache ressources issue.
- Closed
-
MAGNOLIA-4520 farFutureCaching and Resource files with dot in name cannot be found
- Closed
-
MAGNOLIA-5712 farFutureCaching and Resource files with dot in name cannot be found
- Closed
-
MAGNOLIA-4160 Allow dots in node names
- Closed
-
MAGNOLIA-2343 Replace current implementation for selectors by a more flexible mechanism
- Closed
-
MGNLRES-171 Move Resource and CssFile classes to Site module where they belong
- Closed
-
MGNLSITE-20 Move Resource and CssFile classes from Resources to Site module where they belong
- Closed
-
MAGNOLIA-6217 Review names and "duties" of Filters
- Open
-
MAGNOLIA-2580 node names: allow dots
- Closed