Closed (won't fix)
Project:
Google Analytics
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Feb 2011 at 10:47 UTC
Updated:
1 Jul 2014 at 00:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
hass commentedAnother easy solution would be, not using local file caching, too. :-)
Comment #2
catchGot your message this morning, but by the time I'd got the patch ready the release was already up.
Here's the patch though, tested locally and appears to work fine. You only get the file_exists() optimization if you're using clean urls, otherwise it falls back to the current method.
Comment #3
catchminus a typo.
Comment #4
hass commentedWe may should better make the filename a fixed name to allow other ga releated modules to re-use the folder if they like.
Topic of this thread is "Removing file_exists()", but we still have one!?
I would move the 'application/javascript' down and use it directly as value for 'Content-Type'.
Comment #5
catchOK here's a revised patch. I hardcoded the filename in hook_menu(), no real need to make that generic. Also made the style change for Content-Type
On the file_exists() - I'm removing the file_exists() from the page rendering only.
Currently every page request to a site with this enabled has to check the existence of the cached javascript before it links to the js, and regenerates inline it if not. By ensuring the file is always available - with the menu callback taking over when it doesn't exist, we skip that file_exists(), and this also means that when the file doesn't exist, it doesn't hold up the page rendering at all (beyond the js file itself taking a bit longer).
The cron, and the checks in _googleanalytics_cache() are still needed, but those are much less of an issue since they'll run much more infrequently.
Comment #7
catchCheckout was out of date, here it is against HEAD.
Comment #8
hass commentedFound one typo "applicatoin".
Comment #9
catchOuch. Fixed in this patch.
Comment #10
hass commented@catch: Have you been able to get the basics into D8 core?
Comment #11
hass commentedComment #12
hass commentedSince agrcache has not really a high usage and you can just disable the local caching without any negative effect I recommend doing this as a workaround until core implements something intelligent with magic...