Conversation
@mwmiller nicely done. What exactly was the problem? And how does this fix it? I don't fully understand what's happening differently looking at the diff |
The short version is that ddh6 somehow has different stuff on its SERP than duckduckgo.com. This means we can't find a particular asset (notably, in this case, what becomes the This fix, then, just assumes we're OK with empty files in cases where they aren't included on the SERP. I'd like to put a little time into fixing this in a more general way. |
Ah. @mwmiller I see what the problem is. DDH6 is in dev mode. With the recent Grunt changes, the names of the dev versions of the required JS have changes. Base.js and Serp.js are the new names. Those need to be updated in the regex that check for page assets and I think the problem should be resolved if I'm correct. |
i.e. https://github.com/duckduckgo/p5-app-duckpan/blob/mwm/missing_files/lib/App/DuckPAN/Cmd/Server.pm#L265 should look for `/base.js/ is stead of "duckduck" |
@moollaza I figured this was (more or less) what was happening, but I still think that the regex-based matching is pretty fragile. |
@mwmiller that last commit is great. Looks like you need to rebase though? |
@moollaza I meant to tag this with WIP, too. I got distracted and haven't completed my testing. |
4c6efd2
to
511f54c
Compare
@mwmiller ah, no prob 👍 |
1a2014e
to
4429a05
Compare
I am removing the WIP label from this, because I feel it is done. It could still use copious testing more environments. Assuming it works as well for everyone else as it does for me, it's a huge win for getting a working environment relatively quickly on a poor-quality internet connection. In a few moments, I'll update the description to more completely indicate what is included. |
f38b516
to
521fa6b
Compare
This is still far too tied to a particular page layout, but it won't die now. Fixes #151. (With improvements to come)
This makes a more straight-forward path through the code to understand what is happening. Also more commenting on the files themselves, to make it easier to review in-browser.
This is still not _exactly_ what I want, but we're getting closer.
This allows for a much better experience when working on a slow link. - Allow caching of everything (including perl module status and HTML pages) for 4 hours, by default. - Provide an option to change the cache lifetime (-c=0 is more or less equivalent to -f) - Store un-changed files in cache, updating them just before preparing to serve. - Always read from cached file, which helps ensure they will be reusable, even when the force is on. Still a problem: country.json
- Make it possible to recognize paritally downloaded files, exiting and removing them from the cache. - Add Term::ProgressBar for download tracking. - Replace die with exit_with_msg. - Update exit_with_msg for better visual on multi-line messages.
Only copy over files without external soruces (notably duckpan.js, at present)... everything else is either gotten fresh or cache-checked. I don't even know how these managed to get distributed to me, but ah, well.
Also: - Remove now incorrect comment. - Simplify the external/dist logic a bit.
521fa6b
to
7b3adca
Compare
This straightens out the directory structure, while also expanding the application of path().
@moollaza Getting to your actual point, now that I've gone off the deep-end and rewritten much of the caching. 😁 Do I want to add 'base' to the 'duckduck' and 'serp' to the 'duckpan' regexes? |
@mwmiller yes the dev files we need are |
If you're changing the hostname, you're probably looking for different assets. Also, look for new gruny-style filenames which addresses #151.
@mwmiller made a small update to your latest commit -- this should be good now 👍 |
Tested and looks good. @mwmiller thanks a lot for the tremendous improvements 😃 |
--cachesec
/-c
to control cache lifetime.-c=0
is very similar to-f