据我读完这些链接后的理解:
How to find out what does dispatcher cache?
http://docs.adobe.com/docs/en/dispatcher.html
The Dispatcher always requests the document directly from the AEM instance in the following cases:
If the HTTP method is not GET. Other common methods are POST for form data and HEAD for the HTTP header.
If the request URI contains a question mark "?". This usually indicates a dynamic page, such as a search result, which does not need to be cached.
The file extension is missing. The web server needs the extension to determine the document type (the MIME-type).
The authentication header is set (this can be configured)
但我想用参数缓存url。
如果我曾经请求myUrl/?p1=1&p2=2&p3=3
然后,必须从调度程序缓存提供对myUrl/?p1=1&p2=2&p3=3
的下一个请求,但myUrl/?p1=1&p2=2&p3=3&newParam=newValue
应首次由CQ服务,并从后续请求的调度程序缓存服务。
我认为配置/ignoreUrlParams
是你正在寻找的。它可用于白名单查询参数,这些参数用于确定页面是否从缓存中缓存/传递。
查看http://docs.adobe.com/docs/en/dispatcher/disp-config.html#Ignoring%20URL%20Parameters了解详情。
无法缓存包含查询字符串的请求。这样的调用被认为是动态的,因此不应该期望它们被缓存。
另一方面,如果您确定应该缓存此类请求,因为您的应用程序/功能是查询驱动的,您可以通过这种方式处理它。
选择器可以用以下方式构造:key_value
但是对可以在这里传递的内容施加一些约束。
你可以用Apache重写这样做,但这不是理想的做法。你将打破AEM使用的模式。
相反,使用选择器和扩展。例如。而不是server.com/mypage.html?somevalue=true,请使用:server.com/mypage.myvalue-true.html
您将需要执行的大多数事情都可以通过这种方式正常工作。如果您向我提供有关您的要求以及您想要实现的目标的更多详细信息,我可以帮助您完善解决方案。