Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

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

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

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant