CrookedStyleSheets
CrookedStyleSheets copied to clipboard
tracking multiple clicks/hovers/events
You can have the track.php
script return a 404
. The browser won't cache the response and attempt to get it again on the next event.
Ok, i will test it and try to implement this.
I tried this and it didnt worked for me (in Chrome and Firefox). I tried some other status codes and some cache control headers, but i was not able to have the browser request a css url multiple times...
Strange. I was able to get it to work locally. I'll take a look again tomorrow.
Browsers will tend to remember a 404 and serve the response from the cache if possible. If the content isn't available it may well default to the internal error page. Returning a 200 with valid (but unused) content, like some empty dummy class or maybe even empty string would prevent the request showing up as an invalid one in the console.
102 and 202 look like fun responses to subvert though 304 (commonly seen, so easily ignored) might be a sneakier option.
maybe you could work on cache controlling header on server side Cache-control: private, max-age=0, no-cache E-tag etc.
I think this does not matter with the cache. Firstly, we should focus on how to trigger request css resources repeatedly but not on how to disable the cache.
@diamont1001 By not allowing the resource to be cached by the browser it will try to get the resource again the next time that it's requested.
We're not talking about caching the resource across browser page loads and reloads. This is about not letting the browser cache the resource at all.
@notVitaliy OK, maybe we should try the following steps first:
- set
background-image: url(xxx);
to<a>
in demo page, for example:
a.btn:hover {
background-image: url(xxxxxxxx);
}
- open
dev-tools
and load demo page in browser - clear the browser's cache (all)
- Move your mouse over the
<a>
again and again - check the 'network' in
dev-tools
maybe you should split this into two issues - one for php server code and one for css?
@notVitaliy Seems its not posible to fetch URL(X) each time on focus in single session.
Im write some code (at https://github.com/Bogdaan/spycss-demo), and try almost all HTTP/1.1 codes. Browser always cache first response in single session. Only after page refresh it can be downloaded again.