Issue tracker moved to https://gitlab.archlinux.org/archlinux/aurweb/-/issues
FS#25742 - Add ETag support for package pages
Attached to Project:
AUR web interface
Opened by kachelaqa (kachelaqa) - Wednesday, 24 August 2011, 12:20 GMT
Last edited by Lukas Fleischer (lfleischer) - Sunday, 14 June 2015, 17:02 GMT
Opened by kachelaqa (kachelaqa) - Wednesday, 24 August 2011, 12:20 GMT
Last edited by Lukas Fleischer (lfleischer) - Sunday, 14 June 2015, 17:02 GMT
|
DetailsETags are currently added for rpc requests and automatically generated for static files like the PKGBUILD and tarball. Would it be possible to add them for package pages?
According to this post[1], the total number of package page requests is "a distant second" to rpc info requests. However, there is much more potential for saving bandwidth by caching package pages as the average content length is much greater than for rpc output. I think that a lot of AUR helper programs will still be scraping package pages as it remains the only/easiest way to obtain certain information (e.g. the comments, and the dependency and required-by lists). [1]aur-dev@archlinux.org/msg01323.html"> http://www.mail-archive.com/aur-dev@archlinux.org/msg01323.html |
This task depends upon
In regard to comments and required-by list, I don't even know why an AUR helper should display/parse them in any way. In my understanding, AUR helpers are designed to be a counterpart to pacman(8) for the AUR. pacman(8) doesn't check the BBS for comments on packages in our repos, also, and, afaik, it has no option to scan all repositories for packages that depend on some given package. Doing these things wouldn't be KISS, wouldn't be the Arch way.
As for comments, these are much more relevant for AUR packages than for official packages because they often contain useful information that can help solve problems with the build process. The yaourt AUR program displays comments before prompting the user to view/edit the PKGBUILD, for instance.
With regard to pacman and required-by: the relevant libalpm function is alpm_pkg_compute_requiredby. This is used by pacman -Qt and pactree -r.
But I have to say I find your overall response a little hard to understand. If the information displayed on the package page is so irrelevant, why go to the trouble of showing it to users all?
For local packages, alpm_pkg_compute_requiredby() does only search the local database (that is what you see when running `pacman -Qi` or `pactree -r`). pacman(8) will handle AUR packages as well in this case. The only thing that is obviously hard to do is the counterpart of `pacman -Sii` - search in sync databases, as there isn't any sync database of the AUR. The issue here is that it is impossible to create a proper database of all AUR packages, since there isn't any way to detect all packages that a binary package (built from an AUR source tarball) will depend on (dependencies might be architecture-specific etc.). This is another reason for the AUR not showing reliable required-by lists on the package details page, and another reason for AUR helpers not to depend on them.
Think of the AUR web interface as the default frontend to the package database of the AUR. Just like any other frontend (which might be an AUR helper or $whatever), it extracts the PKGBUILD and parses several fields (package name, package version, dependencies, ...) The only difference to a good AUR helper is that it doesn't do a very good job at parsing PKGBUILDs - mainly due to security reasons. Other frontends should not re-parse the output of our official frontend but use the raw data from the backend and parse stuff themselves.
On the question of alpm_pkg_compute_requiredby: for local packages, and packages loaded from file, only the local database is searched; but for any other packages, all the available sync databases are searched. However, it really doesn't matter that the AUR can't match the capabilities of libalpm. Given it's nature, nobody should ever expect 100% reliable information from the AUR.
As for your other points: The problem of parsing pkgbuilds is irrelevant. AUR helpers only scrape the web interface for information that they can't get from pkgbuilds (or the rpc api). The real problem is that the AUR is a walled garden. Creating a genuinely alternate frontend is impossible without direct access to its database.
But, anyway, to get back on topic: if the implementation of etags is simple and there's minimal overhead, isn't adding them a generally good idea?
Still not sure about ETags for the package details pages. I won't add them for the sake of better support for crappy AUR helpers for sure. Nevertheless, we could reduce bandwidth here and users browsing packages the official way might profit as well.
How etags might be used in practice is neither here nor there. The aim is just to exploit a relatively cheap and simple means of reducing bandwidth for all interested parties.