Git Product home page Git Product logo

Comments (5)

FlusherDock1 avatar FlusherDock1 commented on May 30, 2024

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.

robballantyne avatar robballantyne commented on May 30, 2024

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.

FlusherDock1 avatar FlusherDock1 commented on May 30, 2024

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.

robballantyne avatar robballantyne commented on May 30, 2024

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.

FlusherDock1 avatar FlusherDock1 commented on May 30, 2024

Conversation moved to PR #16

from quicksilver.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.