coowoole / vosao

Automatically exported from code.google.com/p/vosao
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Avoid caching page (with Velocity Macros) when url parameters change #527

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have a page with velocity macros that reads a parameter from the request 
object (e.g. "?page=1" to implement paging)
2. Load that page in the browser without the parameter (also will work with one 
value for the parameter) such as http://site.com/faq
3. Our page generates an html page that includes a link to the next page, with 
url http://site.com/faq?page=1 but you can do this simply adding the "?page=1" 
parameter to the url in the browser

What is the expected output? What do you see instead?
It should load the page, executing the velocity macro and generate a new html 
for the second page of ouput.

Instead, it seems the server has cached the generated HTML, and returns it, 
hence the velocity macro is not executed and you get "page 0" content instead 
of "page 2" content.

I think that the url should NOT be cached if any part of the url (not just the 
path) has changed, including parameters, hash, etc.?

Disabling caching on this page in Vosao provides a workaround, but then we are 
not caching each of the generated pages "page 0", "page 1" etc

Please use labels and text to provide additional information
caching
url
url parameters
velocity

Original issue reported on code.google.com by andrew.m...@bcntouch.com on 15 Nov 2011 at 11:16