-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GStudioLITE : Optimization of GStudio by backend caching with revalidation. #1979
Open
ansuman-eng
wants to merge
12
commits into
gnowledge:master
Choose a base branch
from
ansuman-eng:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ansuman1998 , can you specify how to go ahead after taking this pull locally?
Example PR description for reference: |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The entirety of our group's work in the Summer of 2018 as a part of BITS Pilani's Practice School-I. The project aimed at optimizing GStudio by setting up a backend Filesystem-based caching. The trade-off of dynamic nature was kept to as minimal as possible. A few utilitarian scripts have also been included.
We stood up the back-end cache by configuring the settings.py file as in the image below. The relative order of MIDDLEWARE is critical. Do not change it. To be on the safe side, the first MIDDLEWARE should be placed first in the list of actual MIDDLEWARES - as should the last one be kept at the end.
A path on File-system must be provided to the Cache where-in the responses will be cached. Do not use the same path as in the image.
MAX_ENTRIES has to be adjusted according to the size of the website. TIMEOUT is in seconds and doesn't really matter at this point since the max_age parameter of cache_control (see below) has a higher precedence. It has just been added for the sake of completion.
A Selenium-based web-crawler was designed to parse through all the pages of any web-site based on GStudio. It's aim is to request multiple resources so that the responses to them are cached in the File-System in a one-time manner. Dependencies for the same have been added in the requirements.txt file.
Cache-revalidation was also set in place by using cache_control decorators. Any view which rendered a response was provided with that decorator. This forces the cache to revalidate the stale responses before sending them over to the client side. It is a convenient and robust method of cache-revalidation which can scale efficiently. The mechanism of cache revalidation is as follows.
Finally there is a GStudioLITE_README under doc/developers which contains a more extensive documentation and synopsis of the project.
Please review the changes.