@@ -134,6 +134,61 @@ servers can make HTTPS connections to the following hostname:
134134This is only recommended for systems unable to use GeoIP Update or for clients
135135using the CSV-format databases.
136136
137+ ### Download best practices
138+
139+ At a high-level, the best practice is to write an automated script that
140+ periodically checks the ` last-modified ` header for the database's build date,
141+ and downloads the database when the ` last-modified ` time is later than the
142+ ` last-modified ` time of the latest local copy of the database.
143+
144+ It is good to check periodically throughout the day for a release so that you do
145+ not rely on an update schedule, and so that you catch off-schedule releases.
146+
147+ ### Checking for the Latest Release Date
148+
149+ You can check the date of a given database’s latest release by issuing a HEAD
150+ request for that database’s download permalink URL. The download permalink can
151+ be found in the
152+ [ Download Databases] ( https://www.maxmind.com/en/accounts/current/geoip/downloads )
153+ section of your account portal.
154+
155+ For example, using the permalink for the GeoIP2 City CSV database, you can issue
156+ a ` curl ` command like the following:
157+
158+ ``` bash
159+ curl -I -L -u YOUR_ACCOUNT_ID:YOUR_LICENSE_KEY \
160+ ' https://download.maxmind.com/geoip/databases/GeoIP2-City-CSV/download?suffix=zip'
161+ ```
162+
163+ Or a ` wget ` command like the following:
164+
165+ ``` bash
166+ wget -S \
167+ --method HEAD \
168+ --user=YOUR_ACCOUNT_ID \
169+ --password=YOUR_LICENSE_KEY \
170+ ' https://download.maxmind.com/geoip/databases/GeoIP2-City-CSV/download?suffix=zip'
171+ ```
172+
173+ Where ` YOUR_ACCOUNT_ID ` is a placeholder for your account ID and
174+ ` YOUR_LICENSE_KEY ` is a placeholder for your license key.
175+ [ Learn more about license keys on our knowledge base] ( https://support.maxmind.com/hc/en-us/articles/4407116112539-Using-License-Keys ) .
176+
177+ In the response, you can check the ` last-modified ` header for the file’s build
178+ date, or you can check the ` content-disposition ` header for the date that would
179+ appear in the file name. These checks can be incorporated into your own script
180+ or program, according to your needs.
181+
182+ This method only issues a HEAD request, rather than a download request, so
183+ running this check won’t count against your
184+ [ daily database download limit] ( https://support.maxmind.com/hc/en-us/articles/4408216129947 ) .
185+
186+ ### Automating downloads
187+
188+ The steps for automating downloads of the databases are similar to the steps for
189+ checking the latest release date. Instead of checking the file HEAD, you will
190+ download the file.
191+
137192In order to download the databases from a script or program, please use the
138193permalinks found on the
139194[ GeoIP download page] ( https://www.maxmind.com/en/accounts/current/geoip/downloads ) .
@@ -190,45 +245,6 @@ documentation pages (see
190245and
191246[ tutorials for importing CSV databases into SQL] ( /geoip/importing-databases ) .
192247
193- ### Checking for the Latest Release Date
194-
195- You can check the date of a given database’s latest release by issuing a HEAD
196- request for that database’s download permalink URL. The download permalink can
197- be found in the
198- [ Download Databases] ( https://www.maxmind.com/en/accounts/current/geoip/downloads )
199- section of your account portal.
200-
201- For example, using the permalink for the GeoIP2 City CSV database, you can issue
202- a ` curl ` command like the following:
203-
204- ``` bash
205- curl -I -L -u YOUR_ACCOUNT_ID:YOUR_LICENSE_KEY \
206- ' https://download.maxmind.com/geoip/databases/GeoIP2-City-CSV/download?suffix=zip'
207- ```
208-
209- Or a ` wget ` command like the following:
210-
211- ``` bash
212- wget -S \
213- --method HEAD \
214- --user=YOUR_ACCOUNT_ID \
215- --password=YOUR_LICENSE_KEY \
216- ' https://download.maxmind.com/geoip/databases/GeoIP2-City-CSV/download?suffix=zip'
217- ```
218-
219- Where ` YOUR_ACCOUNT_ID ` is a placeholder for your account ID and
220- ` YOUR_LICENSE_KEY ` is a placeholder for your license key.
221- [ Learn more about license keys on our knowledge base] ( https://support.maxmind.com/hc/en-us/articles/4407116112539-Using-License-Keys ) .
222-
223- In the response, you can check the ` last-modified ` header for the file’s build
224- date, or you can check the ` content-disposition ` header for the date that would
225- appear in the file name. These checks can be incorporated into your own script
226- or program, according to your needs.
227-
228- This method only issues a HEAD request, rather than a download request, so
229- running this check won’t count against your
230- [ daily database download limit] ( https://support.maxmind.com/hc/en-us/articles/4408216129947 ) .
231-
232248## Changes to file size between updates
233249
234250It is expected for database files to increase or decrease in size from time to
0 commit comments