• <i id='p0DFN'><tr id='p0DFN'><dt id='p0DFN'><q id='p0DFN'><span id='p0DFN'><b id='p0DFN'><form id='p0DFN'><ins id='p0DFN'></ins><ul id='p0DFN'></ul><sub id='p0DFN'></sub></form><legend id='p0DFN'></legend><bdo id='p0DFN'><pre id='p0DFN'><center id='p0DFN'></center></pre></bdo></b><th id='p0DFN'></th></span></q></dt></tr></i><div id='p0DFN'><tfoot id='p0DFN'></tfoot><dl id='p0DFN'><fieldset id='p0DFN'></fieldset></dl></div>
  • <legend id='p0DFN'><style id='p0DFN'><dir id='p0DFN'><q id='p0DFN'></q></dir></style></legend>

  • <tfoot id='p0DFN'></tfoot>

    <small id='p0DFN'></small><noframes id='p0DFN'>

    • <bdo id='p0DFN'></bdo><ul id='p0DFN'></ul>

        从网站/cdn 跟踪下载完成情况

        tracking download completions from a website/cdn(从网站/cdn 跟踪下载完成情况)

        <i id='e1nn9'><tr id='e1nn9'><dt id='e1nn9'><q id='e1nn9'><span id='e1nn9'><b id='e1nn9'><form id='e1nn9'><ins id='e1nn9'></ins><ul id='e1nn9'></ul><sub id='e1nn9'></sub></form><legend id='e1nn9'></legend><bdo id='e1nn9'><pre id='e1nn9'><center id='e1nn9'></center></pre></bdo></b><th id='e1nn9'></th></span></q></dt></tr></i><div id='e1nn9'><tfoot id='e1nn9'></tfoot><dl id='e1nn9'><fieldset id='e1nn9'></fieldset></dl></div>

          <small id='e1nn9'></small><noframes id='e1nn9'>

        • <legend id='e1nn9'><style id='e1nn9'><dir id='e1nn9'><q id='e1nn9'></q></dir></style></legend><tfoot id='e1nn9'></tfoot>

            • <bdo id='e1nn9'></bdo><ul id='e1nn9'></ul>
                    <tbody id='e1nn9'></tbody>
                  本文介绍了从网站/cdn 跟踪下载完成情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 Drupal 网站,用户在该网站上点击一个链接,从内容交付网络 (CDN) 启动文件下载.脚本正在跟踪单击链接以开始下载过程的用户数量.我正在寻找有关如何跟踪成功完成下载过程的用户数量的建议.

                  I have a Drupal website where users are clicking on a link that initiates a file download from a content delivery network (CDN). A script is tracking the number of users who click the link to begin the download process. I'm looking for suggestions on how I might track the number of users who successfully complete the download process.

                  推荐答案

                  如果您只需要下载次数,只需从 CDN 中获取原始日志并通过日志分析工具运行它们.大多数 CDN 提供每日访问日志作为标准服务.较大的玩家可以做每小时记录或更好.

                  If you only need the number of completed downloads, just grab the raw logs from your CDN and run them through a log analysis tool. Most CDNs provide daily access logs as a standard service. The bigger players can do hourly logs or better.

                  最佳解决方案取决于您的 CDN,所以如果您还没有,请与他们联系.但是,这就是我过去的做法.

                  The best solution will depend on your CDN, so talk to them if you haven't already. However, here's how I've done it in the past.

                  对于生成的每个受保护的下载 URL,为发出请求的用户附加一个唯一的 ID.典型的 CDN 下载 URL 可能包含到期时间和哈希值以防止篡改.您需要先检查您的 CDN,以确保您选择的变量名称不会与其 API 冲突.在我们的例子中,我们同意使用前缀 ign_*(意思是忽略.)

                  To each protected download URL generated, append a unique id for the user who made the request. A typical CDN download URL might contain an expiry time and a hash to prevent tampering. You'll want to check with your CDN first to make sure you pick a variable name that doesn't clash with their API. In our case we agreed on a prefix of ign_* (meaning ignore.)

                  之前:

                  http://cdn.example.com/path/to/file.ext?e=EXPIRES&h=HASH
                  

                  之后:

                  http://cdn.example.com/path/to/file.ext?e=EXPIRES&ign_u=USERID&h=HASH
                  

                  示例(用户 1234 的下载链接):

                  Example (download link for user 1234):

                  http://cdn.example.com/path/to/file.ext?e=1356088260&ign_u=1234&h=39341385b9d99730646d927f620111e1
                  

                  现在,当您下载原始日志时,只需解析查询字符串,就可以将每个条目与您的一个用户相关联.在这里,您可以执行从计算已完成下载的数量到实现每用户下载报告的所有操作.

                  Now when you download your raw logs, each entry can be associated with one of your users simply by parsing the query string. From here you can do everything from counting the number of completed downloads, to implementing per-user download reports.

                  在我们的例子中,我们每 15 分钟就有一次可用的日志,我自动执行了获取和处理以启用字节级别的每用户下载配额.

                  In our case, we had logs available every 15 minutes and I automated the fetching and processing to enable byte-level per-user download quotas.

                  要记住的一件事是,如果您要自己处理日志,请将 HTTP 206 部分条目组合在一起.特别是如果您对已完成下载的数量"感兴趣.

                  One thing to keep in mind, if you're going to be processing the logs yourself, is to group HTTP 206 partial entries together. Particularly if you're interested in the "number of completed downloads."

                  这篇关于从网站/cdn 跟踪下载完成情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How do I pass parameters into a PHP script through a webpage?(如何通过网页将参数传递给 PHP 脚本?)
                  PHP - include a php file and also send query parameters(PHP - 包含一个 php 文件并发送查询参数)
                  Where can I read about conditionals done with quot;?quot; and quot;:quot; (colon)?(我在哪里可以阅读有关使用“?完成的条件的信息?和“:(冒号)?)
                  Accessing arrays whitout quoting the key(在不引用键的情况下访问数组)
                  What is the name for the quot;lt;lt;lt;quot; operator?(“lt;lt;lt;的名字是什么?操作员?)
                  default as first option in switch statement?(默认为 switch 语句中的第一个选项?)
                  <i id='wVRUa'><tr id='wVRUa'><dt id='wVRUa'><q id='wVRUa'><span id='wVRUa'><b id='wVRUa'><form id='wVRUa'><ins id='wVRUa'></ins><ul id='wVRUa'></ul><sub id='wVRUa'></sub></form><legend id='wVRUa'></legend><bdo id='wVRUa'><pre id='wVRUa'><center id='wVRUa'></center></pre></bdo></b><th id='wVRUa'></th></span></q></dt></tr></i><div id='wVRUa'><tfoot id='wVRUa'></tfoot><dl id='wVRUa'><fieldset id='wVRUa'></fieldset></dl></div>

                    • <small id='wVRUa'></small><noframes id='wVRUa'>

                            <tbody id='wVRUa'></tbody>
                          <tfoot id='wVRUa'></tfoot>
                          <legend id='wVRUa'><style id='wVRUa'><dir id='wVRUa'><q id='wVRUa'></q></dir></style></legend>
                            <bdo id='wVRUa'></bdo><ul id='wVRUa'></ul>