How to restrict spring controller to process duplicate get requests from browser [closed]












1














I'm working on one application which is based on spring MVC architecture. We have a controller method of request type GET and returns some jsp after some calculations.
Before page got rendered completely on browser window,user can refresh the page continuously. This is increasing the page load time .To get rid of performance issues,I would like to handle these duplicate requests at back end.

Please suggest the best way to handle these kind of scenarios at back end.










share|improve this question















closed as too broad by dur, Hovercraft Full Of Eels, eyllanesc, sideshowbarker, Makyen Nov 17 at 0:29


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 1




    You can add a servlet filter for this scenario
    – akuma8
    Nov 12 at 13:38
















1














I'm working on one application which is based on spring MVC architecture. We have a controller method of request type GET and returns some jsp after some calculations.
Before page got rendered completely on browser window,user can refresh the page continuously. This is increasing the page load time .To get rid of performance issues,I would like to handle these duplicate requests at back end.

Please suggest the best way to handle these kind of scenarios at back end.










share|improve this question















closed as too broad by dur, Hovercraft Full Of Eels, eyllanesc, sideshowbarker, Makyen Nov 17 at 0:29


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 1




    You can add a servlet filter for this scenario
    – akuma8
    Nov 12 at 13:38














1












1








1







I'm working on one application which is based on spring MVC architecture. We have a controller method of request type GET and returns some jsp after some calculations.
Before page got rendered completely on browser window,user can refresh the page continuously. This is increasing the page load time .To get rid of performance issues,I would like to handle these duplicate requests at back end.

Please suggest the best way to handle these kind of scenarios at back end.










share|improve this question















I'm working on one application which is based on spring MVC architecture. We have a controller method of request type GET and returns some jsp after some calculations.
Before page got rendered completely on browser window,user can refresh the page continuously. This is increasing the page load time .To get rid of performance issues,I would like to handle these duplicate requests at back end.

Please suggest the best way to handle these kind of scenarios at back end.







spring spring-mvc spring-security spring-filter






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 at 10:20

























asked Nov 12 at 13:27









Venkatesh Kadali

62




62




closed as too broad by dur, Hovercraft Full Of Eels, eyllanesc, sideshowbarker, Makyen Nov 17 at 0:29


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as too broad by dur, Hovercraft Full Of Eels, eyllanesc, sideshowbarker, Makyen Nov 17 at 0:29


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    You can add a servlet filter for this scenario
    – akuma8
    Nov 12 at 13:38














  • 1




    You can add a servlet filter for this scenario
    – akuma8
    Nov 12 at 13:38








1




1




You can add a servlet filter for this scenario
– akuma8
Nov 12 at 13:38




You can add a servlet filter for this scenario
– akuma8
Nov 12 at 13:38












1 Answer
1






active

oldest

votes


















0














It is possible to reduce by some steps:




  • You can use cache on the backend using Infispan or EhCache using
    spring Cache , so if the result was generated and done it would cache it and gives response without calculating again

  • Actually you can redirect from calls to another controller , that use
    would not trigger the same endpoint many times , but it will request
    another which will not affect one you mentioned


Here is tutorial on spring Cache




  • https://www.baeldung.com/spring-cache-tutorial


I know one more thing which is called Post redirect Get , in this case user could sumbit form only one time after that will be redirected to another endpoint and subsequent calls on refresh button will call it.



Here is userful link :




  • https://en.wikipedia.org/wiki/Post/Redirect/Get


I think this is helpful.






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    It is possible to reduce by some steps:




    • You can use cache on the backend using Infispan or EhCache using
      spring Cache , so if the result was generated and done it would cache it and gives response without calculating again

    • Actually you can redirect from calls to another controller , that use
      would not trigger the same endpoint many times , but it will request
      another which will not affect one you mentioned


    Here is tutorial on spring Cache




    • https://www.baeldung.com/spring-cache-tutorial


    I know one more thing which is called Post redirect Get , in this case user could sumbit form only one time after that will be redirected to another endpoint and subsequent calls on refresh button will call it.



    Here is userful link :




    • https://en.wikipedia.org/wiki/Post/Redirect/Get


    I think this is helpful.






    share|improve this answer




























      0














      It is possible to reduce by some steps:




      • You can use cache on the backend using Infispan or EhCache using
        spring Cache , so if the result was generated and done it would cache it and gives response without calculating again

      • Actually you can redirect from calls to another controller , that use
        would not trigger the same endpoint many times , but it will request
        another which will not affect one you mentioned


      Here is tutorial on spring Cache




      • https://www.baeldung.com/spring-cache-tutorial


      I know one more thing which is called Post redirect Get , in this case user could sumbit form only one time after that will be redirected to another endpoint and subsequent calls on refresh button will call it.



      Here is userful link :




      • https://en.wikipedia.org/wiki/Post/Redirect/Get


      I think this is helpful.






      share|improve this answer


























        0












        0








        0






        It is possible to reduce by some steps:




        • You can use cache on the backend using Infispan or EhCache using
          spring Cache , so if the result was generated and done it would cache it and gives response without calculating again

        • Actually you can redirect from calls to another controller , that use
          would not trigger the same endpoint many times , but it will request
          another which will not affect one you mentioned


        Here is tutorial on spring Cache




        • https://www.baeldung.com/spring-cache-tutorial


        I know one more thing which is called Post redirect Get , in this case user could sumbit form only one time after that will be redirected to another endpoint and subsequent calls on refresh button will call it.



        Here is userful link :




        • https://en.wikipedia.org/wiki/Post/Redirect/Get


        I think this is helpful.






        share|improve this answer














        It is possible to reduce by some steps:




        • You can use cache on the backend using Infispan or EhCache using
          spring Cache , so if the result was generated and done it would cache it and gives response without calculating again

        • Actually you can redirect from calls to another controller , that use
          would not trigger the same endpoint many times , but it will request
          another which will not affect one you mentioned


        Here is tutorial on spring Cache




        • https://www.baeldung.com/spring-cache-tutorial


        I know one more thing which is called Post redirect Get , in this case user could sumbit form only one time after that will be redirected to another endpoint and subsequent calls on refresh button will call it.



        Here is userful link :




        • https://en.wikipedia.org/wiki/Post/Redirect/Get


        I think this is helpful.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 12 at 13:43

























        answered Nov 12 at 13:38









        Mykhailo Moskura

        839112




        839112















            Popular posts from this blog

            Xamarin.iOS Cant Deploy on Iphone

            Glorious Revolution

            Dulmage-Mendelsohn matrix decomposition in Python