New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query-params in origin URL should have ? escaped in rewritten URL #114

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 4 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Apr 6, 2015

Currently if we have

<img src="images/myimage.jpg?param">

we will rewrite it into something like this:

<img src="images/ce.HASH.myimage,j?param.jpg">

We should escape the "?" so it doesn't get interepreted as a query-param thus 
preventing proxy caches from caching it.

Original issue reported on code.google.com by jmara...@google.com on 24 Nov 2010 at 10:24

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

But it *is* a query param, isn't it?  OK, I understand that ultimately we will 
serve by content-hash.  But is this actually wrong?

Original comment by jmaes...@google.com on 25 Nov 2010 at 5:07

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Well, you may cache contents even when having a query param if the original 
cache headers would allow you to do so.
I dont get where the problem is? Proxys should never try to parse the URL, they 
should always take the full URL (including query params) when caching and only 
follow the cache headers. So when a proxy fails to cache the image from the 
example because there is an ? in the URL, then the proxy is faulty.

Original comment by Andreas....@gmail.com on 27 Nov 2010 at 1:05

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Fixed in http://code.google.com/p/modpagespeed/source/detail?r=262

Original comment by jmara...@google.com on 30 Nov 2010 at 7:09

  • Changed state: Fixed
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

@jmaessen -- the query-params in the origin URL should not surface as 
query-params in the rewritten URL.

@Andreas -- our experience is that many proxy caches are broken and our "best 
practices" guide tells us to avoid query-params to help broken proxy caches 
continue to make the web faster.  It's possible that the situation has changed 
since these "best practices" were authored and many proxy caches are now 
functional, in which case we could, in principle, use query-params for our 
rewritten URLs, say, to hold meta-data.  But we have no real need to use 
query-params at this point so we're probably going to err on the side of 
conservatism for the near future.


Original comment by jmara...@google.com on 30 Nov 2010 at 7:12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment