Comments (5)
Hi! Thanks for your review!
Try this configuration instead one in docs and let me know if it resolved your problem with query strings:
##
## Serve Cached Page If Available
##
RewriteCond %{QUERY_STRING} ^(.)
RewriteCond %{REQUEST_URI} !(.+)\.(png|jpg|jpeg|gif|js|css|json|mp3|mp4|mov|ogv|ogg|ico|woff|ttf)$ [NC]
RewriteRule !^index.php index.php [L,NC]
RewriteCond %{REQUEST_URI} ^/?$
RewriteCond %{DOCUMENT_ROOT}/storage/page-cache/pc__index__pc.html -f
RewriteRule .? /storage/page-cache/pc__index__pc.html [L]
RewriteCond %{DOCUMENT_ROOT}/storage/page-cache%{REQUEST_URI}.html -f
RewriteRule . /storage/page-cache%{REQUEST_URI}.html [L]
RewriteCond %{HTTP:X-Requested-With} XMLHttpRequest
RewriteRule !^index.php index.php [L,NC]
from quicksilver.
Thanks for this, but it's not a problem with the rewrites (actually I use nginx anyway) but a feature enhancement I am looking for.
The original laravel package does not support caching with query strings as files are only saved by path and file/slug which is fine, but I would like to enable the caching of each file along with variants generated according to the passed parameters - Biggest perceived difficulty is matching the correct file I think.
This is obviously a lot more complicated and it might be difficult to implement but I would like to tackle the problem anyway as file caching gives such a massive performance boost.
Hope this makes sense!
from quicksilver.
The original laravel package does not support caching with query strings as files are only saved by path and file/slug which is fine, but I would like to enable the caching of each file along with variants generated according to the passed parameters - Biggest perceived difficulty is matching the correct file I think.
I had similar idea, and actually I tried to make it real, but that same code worked with apache server but not with nginx, so i dropped it. If you want, you can try to make it and submit PR.
from quicksilver.
Will do.
I have it working (needs some testing before I push to my fork) for Nginx. Should be alright for Apache, too.
I have also added support for json, rss, xml and txt files by uri explicit extension or response content-type header all with query string support but requires changes to how files are saved (and will therefore need adjustments to cache clearing etc.)
My file format is $uri[q_$args].$extension
and the corresponding nginx location block is
try_files $uri $uri/ \
/storage/page-cache/${uri}[q_${args}].html \
/storage/page-cache/${uri}[q_${args}].json \
/storage/page-cache/${uri}[q_${args}].rss \
/storage/page-cache/${uri}[q_${args}].xml \
/storage/page-cache/${uri}[q_${args}].txt \
/index.php?$query_string;
}
I'll push something later, but just an update on progress.
from quicksilver.
Conversation moved to PR #16
from quicksilver.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quicksilver.