Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clear a cached SPARQL endpoint based on cubes

License

NotificationsYou must be signed in to change notification settings

zazuko/clear-sparql-cache-endpoint

Repository files navigation

This assumes that your cached endpoint is using Varnish and has thexkey module enabled.You can take a look at our customvarnish-post repository that comes with all required configuration for the cached endpoint.

Get started

npm install# Install dependenciescp example.env .env# Copy environment variables file# Open your editor, and fill the environment variables in the `.env` filenpm run start# Start the script

Environment variables

NameDescriptionDefault Value
CACHE_ENDPOINTThe URL of the cache endpoint""
CACHE_ENDPOINT_USERNAMEThe username for the cache endpoint""
CACHE_ENDPOINT_PASSWORDThe password for the cache endpoint""
CACHE_DEFAULT_ENTRY_NAMEThe default entry name for the cache"default"
CACHE_TAG_HEADERThe header name for the cache tag"xkey"
SUPPORT_URL_ENCODEDWhether to clear the cache for the URL-encoded version of the dataset URI"true"
SPARQL_ENDPOINT_URLThe URL of the SPARQL endpoint""
SPARQL_USERNAMEThe username for the SPARQL endpoint""
SPARQL_PASSWORDThe password for the SPARQL endpoint""
S3_ENABLEDWhether to use S3 for caching"false"
S3_LAST_TIMESTAMP_KEYThe key for the last timestamp file in S3"last_timestamp.txt"
S3_SIMPLE_DATE_WORKAROUND_KEYThe key for the simple date workaround file in S3"simple_date_workaround.txt"
S3_BUCKETThe S3 bucket name"default"
S3_ACCESS_KEY_IDThe S3 access key ID""
S3_SECRET_ACCESS_KEYThe S3 secret access key""
S3_REGIONThe S3 region"default"
S3_ENDPOINTThe S3 endpoint""
S3_SSL_ENABLEDWhether to use SSL for S3"false"
S3_FORCE_PATH_STYLEWhether to force path style for S3"false"

IfS3_ENABLED is set totrue, the first time you run the script you might see an error message saying that the last timestamp file does not exist. This is expected, and the script will create the file automatically at the end of the first run, and will update that file every time it runs.You will not see this error message again after the first run.

You might also get a similar error about a simple date workaround file. This is also expected, and the script will create the file automatically at the end of the first run, and will update that file every time it runs.

Using S3 allows us to trick a bit for the cases wheredateModified returned by the SPARQL query is adate and not adateTime.The trick makes sure that the cache is invalidated for this entry only the first time, and the day after thedateModified date.Without this trick, the cache would be invalidated every time the script runs until the day after its value.

License

This project is licensed under the MIT License - see theLICENSE file for details.

About

Clear a cached SPARQL endpoint based on cubes

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp